-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathmy07-analog-test.ino
50 lines (40 loc) · 1.63 KB
/
my07-analog-test.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* Blink, AnalogRead and Serial
* Arduino Portenta Analog test program
*
* By Jeremy Ellis twitter @rocksetta
* Webpage http://rocksetta.com
* Arduino High School Robotics Course at
* https://github.com/hpssjellis/arduino-high-school-robotics-course
*
* Update July 29th, 2020
*
*/
void setup(){
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(9600);
// while (!Serial); // Please don't do this it messes up beginners
}
void loop() {
Serial.println("A0 Analog Read max = 1023, Actual Value: "+String(analogRead(A0)) );
Serial.println("A1 Analog Read max = 1023, Actual Value: "+String(analogRead(A1)) );
Serial.println("A2 Analog Read max = 1023, Actual Value: "+String(analogRead(A2)) );
Serial.println("A3 Analog Read max = 1023, Actual Value: "+String(analogRead(A3)) );
Serial.println("A4 Analog Read max = 1023, Actual Value: "+String(analogRead(A4)) );
Serial.println("A5 Analog Read max = 1023, Actual Value: "+String(analogRead(A5)) );
Serial.println("A6 Analog Read max = 1023, Actual Value: "+String(analogRead(A6)) );
Serial.println("-------------------------------------------------------------------");
Serial.println();
// Flash LED 3 times
digitalWrite(LED_BUILTIN, LOW);
delay(100);
digitalWrite(LED_BUILTIN, HIGH);
delay(100);
digitalWrite(LED_BUILTIN, LOW);
delay(100);
digitalWrite(LED_BUILTIN, HIGH);
delay(100);
digitalWrite(LED_BUILTIN, LOW);
delay(100);
digitalWrite(LED_BUILTIN, HIGH);
delay(3000); // longer wait
}