First testing tool for your LEDs and your Switches

This commit is contained in:
2015-01-12 12:07:51 +01:00
parent 7c4ee3720f
commit 4fedc6e607
3 changed files with 44 additions and 0 deletions

24
tools/testing/testing.ino Normal file
View 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);
}
}