In this lab we explored analog input and output using variable resistors. I also created a circuit that varies the brightness of an LED through photosensor values and SoftPot Membrane Potentiometer values.
For the first part of the lab I created a circuit that would change the brightness of a LED depending on the value of a potentiometer. The code required to make this system work involved reading the analog value of the potentiometer and converting that value so it could be outputed by the LED.
For the second part of the lab I used a touchsensor that varied the brightness of the LED depending on where it was touched and and photosensor that varied the brightness depending on the amount of light it was exposed to. The touch sensor value affected the red LED, while the photosensor varied the yellow LED. Again I used analogRead to get information from the sensors and map() to convert the readings into values that could be outputed by an LED.