Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int potPin = 0; // select the input pin for the potentiometer
- int ledPin = 13; // select the pin for the LED
- int val = 0; // variable to store the value coming from the sensor
- void setup() {
- pinMode(ledPin, OUTPUT); // declare the ledPin as an OUTPUT
- Serial.begin(9600);
- }
- void loop() {
- val = analogRead(potPin);
- val = map(val, 0, 1023, 0, 10);
- Serial.println(val);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement