Lab 3

Part 1

For this lab we used variable resistors as an input for our circuits. Using a potentiometer, we were tasked with creating a circuit that could adjust the brightness of an LED. By connecting  the potentiometer to the one of the analog inputs on the Arduino board we were able to control the amount of energy flowing to the LED.

 

Here is my code

Screen Shot 2018-02-20 at 3.58.19 PM


Part 2

For this part of the lab we had to use the same concepts from part 1 but instead apply it to two different types of variable sensors. By connecting a photocell and a flex sensor to different analog inputs we were able to control two LED’s separately.

WechatIMG29.jpeg

Here is my code

Screen Shot 2018-02-20 at 5.11.08 PM

 


Part 3

Last part of the lab had us create a voltage divider circuit with two photoresistors and an 8 Ohm speaker. First thing I had to do was solder the wires to the speaker.

WechatIMG31.jpeg

img_0536-e1519159444636.jpg

Here is my code

Screen Shot 2018-02-20 at 9.57.24 PM