Skip to content

Instantly share code, notes, and snippets.

@daryllxd
Created October 3, 2014 11:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daryllxd/983163f2692557c5ae8b to your computer and use it in GitHub Desktop.
Save daryllxd/983163f2692557c5ae8b to your computer and use it in GitHub Desktop.
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;
int in = 8;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
Serial.begin(9600);
pinMode(led, OUTPUT);
pinMode(in, INPUT);
}
// the loop routine runs over and over again forever:
void loop() {
int val = 0;
val = digitalRead(in);
digitalWrite(led, val); // wait for a second
delay(250);
Serial.print("P");
if (val == HIGH) {
Serial.println("CTOKWA");
}
Serial.println(val);
Serial.println("");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment