Skip to content

Instantly share code, notes, and snippets.

@taesamja
Created December 28, 2016 01:06
Show Gist options
  • Save taesamja/edcdd045c48db0a55acd8933d4176382 to your computer and use it in GitHub Desktop.
Save taesamja/edcdd045c48db0a55acd8933d4176382 to your computer and use it in GitHub Desktop.
// Our Relay Module is negative operation
int led = 12;
void setup() {
Serial.begin(9600);
pinMode(led, OUTPUT);
//초기화
digitalWrite(led, HIGH); // Relay OFF
}
void loop() {
char indata;
if(Serial.available()) {
indata = Serial.read();
if(indata == 'H')
digitalWrite(led, LOW);
if(indata == 'L')
digitalWrite(led, HIGH);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment