top of page

KYLEE'S DESIGN BLOG

  • Writer's picturekydo5322

Lab 3

In lab 3, I explored analog input and outputs using variable resistors. Specifically, I learned how to use the serial monitor and pulse width modulation through potentiometers, force sensors, and photocells.


Part 1: Potentiometers

This part was all about changing the brightness of an LED through pwm by using a potentiometer.

Here's my circuit:

Here's my code:

Here's my circuit in action:


Part 2: Force Sensor Resistor and Photocell

This part was about expanding on what you learned in part 1 by working with two different sensors.

Here's my circuit:

Here's my code:

Here's my circuit in action:

I struggled with part 2, especially with the photocell. The serial monitor does show that the photocell values are changing, but for some reason the change in the LED's brightness is barely noticeable. I tried trouble shooting the issue, but even the source code I found online for pwm and mapping a photocell had the same issues as my code. Which makes me think there is something wrong with my circuit, but the two sensors are set up in the same fashion and the force sensor works fine.


Part 3: Tone Output

This part was about using a photocell to change the frequencies of tone coming from the speaker.

Here's my circuit:

Here's my code:

Here's my circuit in action:


 

Comments


bottom of page