Created
October 12, 2017 09:44
-
-
Save heborras/8df6934639dcbbcb4654ec16122b7e00 to your computer and use it in GitHub Desktop.
A utility for testing the LED's on an CosmicPi V1.5.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//flash the red/green LED on the cosmic Pi analogue board when | |
//it's connected directly to the Arduino DUE | |
int LED1_pin = 12; // green and lower one | |
int LED2_pin = 11; // red and upper one | |
void setup() { | |
Serial.begin(115200); | |
Serial.println("Cosmic Pi Status: Alive"); | |
pinMode(LED1_pin, OUTPUT); | |
pinMode(LED2_pin, OUTPUT); | |
} | |
void loop() { | |
digitalWrite(LED1_pin, HIGH); | |
digitalWrite(LED2_pin, HIGH); | |
delay(100); | |
digitalWrite(LED1_pin, LOW); | |
digitalWrite(LED2_pin, HIGH); | |
delay(100); | |
digitalWrite(LED1_pin, HIGH); | |
digitalWrite(LED2_pin, LOW); | |
delay(100); | |
digitalWrite(LED1_pin, LOW); | |
digitalWrite(LED2_pin, LOW); | |
delay(100); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment