Make: Wearable Electronics by Kate Hartman
				
							 
							
								
							
							
							Author:Kate Hartman
							
							
							
							Language: eng
							
							
							
							Format: epub, mobi
							
							
							
							Tags: COMPUTERS / Hardware / General
							
							
																				
							ISBN: 9781449336509
							
							
							
							
							
							
							
							Publisher: Maker Media, Inc
							
							
							
							Published: 2014-08-12T04:00:00+00:00
							
							
							
							
							
							
map(lightSensorValue, 25, 940, 0, 255)
Figure 7-14. Mapping a value from 25–940 to 0–255
If you are working with a LilyPad light sensor as your input and using the mapped value to control an LED on the analog output pin, you would have an LED that brightens and dims in a way that mimics the conditions of the room. If you wanted to inverse the relationship so that the LED gets brighter as the room gets darker, you can simply flip the to values, as illustrated in Figure 7-15:
map(lightSensorValue, 25, 940, 255, 0)
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Wonder by R.J. Palacio(8411)
Mastering Adobe Animate 2023 - Third Edition by Joseph Labrecque(3674)
Unlabel: Selling You Without Selling Out by Marc Ecko(3569)
Ogilvy on Advertising by David Ogilvy(3474)
Hidden Persuasion: 33 psychological influence techniques in advertising by Marc Andrews & Matthijs van Leeuwen & Rick van Baaren(3433)
Drawing Cutting Edge Anatomy by Christopher Hart(3432)
The Pixar Touch by David A. Price(3342)
POP by Steven Heller(3295)
The Code Book by Simon Singh(3045)
Slugfest by Reed Tucker(2917)
The Art of War Visualized by Jessica Hagy(2910)
The Curated Closet by Anuschka Rees(2891)
Rapid Viz: A New Method for the Rapid Visualization of Ideas by Kurt Hanks & Larry Belliston(2808)
Stacked Decks by The Rotenberg Collection(2788)
365 Days of Wonder by R.J. Palacio(2730)
The Wardrobe Wakeup by Lois Joy Johnson(2712)
Keep Going by Austin Kleon(2674)
Tattoo Art by Doralba Picerno(2576)
Tell Me More by Kelly Corrigan(2575)
