Skip to content

Commit f2ffe30

Browse files
authored
Create analog-read.ino
1 parent be92228 commit f2ffe30

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Simple read analog potentiometer on Circuit Playground Express or other board with pin change
2+
// Mike Barela for Adafruit Industries 9/2018
3+
4+
// Which pin on the microcontroller board is connected to the NeoPixels?
5+
#define PIN A1 // For Circuit Playground Express
6+
7+
int delayval = 500; // delay for half a second
8+
9+
void setup() {
10+
Serial.begin(9600); // open the serial port at 9600 bps
11+
}
12+
13+
void loop() {
14+
int value;
15+
16+
value = analogRead(PIN); // analog read of potentiometer
17+
18+
Serial.println(value); // print value
19+
20+
delay(delayval); // Delay for a period of time (in milliseconds).
21+
}

0 commit comments

Comments
 (0)