Lab 2 Working with Pots
This Lab worked with analog circuits. This first part was not too challenging. Here is the code that I used for this.
int potPin = 0; // analog pin that pot attaches too “blue wire”
int potValue = 0; //value initial
int led = 9; // displays what the pot is doing
void setup(){
Serial.begin(9600);
}
void loop(){
potValue = analogRead(potPin); //read pot value
analogWrite(led, potValue/4); //pwm led w/ pot value
Serial.println(potValue);//print value
delay(10);
}
Physcomp Lab2 part1 from Zeven Rodriguez on Vimeo.
For more info about this lab click here