Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define potpin 0 // pot is connected to analog pin 0
- int val = 0; // value of pot
- void setup(){
- Serial.begin(9600); // start serial connection @ 9600 baud
- pinMode(potpin, INPUT); // our pot is an input
- }
- void loop(){
- val = analogRead(potpin);
- Serial.println("Pot Val: " + val);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement