Arduino Potentiometer Activities

Background

This is a schematic for your circuit:

null

Some programming basics we will need to know for our program:

null

Assignment

Write a program that builds on the basics we learned about in our Blinking LED circuit, this time using the value returned from our sensorValue variable as the “on” delay value (set the “off” delay value to 500). Use pin A0 for the input from the potentiometer.

After you have this assignment completed, call your instructor over to have it marked.

Assignment 2

Add the statement

Serial.begin(9600);

to your setup() function and the statement

Serial.println(sensorValue);

to your loop() function.

Run this program, then call your instructor over for a discussion on how to convert this value to a voltage value. Modify your program accordingly.

After you have this assignment completed, call your instructor over to have it marked.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.