First testing tool for your LEDs and your Switches
This commit is contained in:
24
tools/testing/testing.ino
Normal file
24
tools/testing/testing.ino
Normal file
@@ -0,0 +1,24 @@
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
for(int i=22; i <= 36; i=i+2) {
|
||||
pinMode(i, INPUT);
|
||||
pinMode(i+1, OUTPUT);
|
||||
}
|
||||
|
||||
for(int i=22; i <= 36; i=i+2) {
|
||||
digitalWrite(i+1, HIGH); // turn the LED on (HIGH is the voltage level)
|
||||
delay(100); // wait for a second
|
||||
digitalWrite(i+1, LOW); // turn the LED off by making the voltage LOW
|
||||
delay(100);
|
||||
}
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
for(int i=22; i <= 36; i=i+2) {
|
||||
byte actState = digitalRead(i);
|
||||
digitalWrite(i+1, actState);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user