close-circle
Close

Arduino Doodle

A project log for Flashing Light Prize (5) IoT Pacing

Stress Shd Be More Stressful

Vije Miller 07/20/2017 at 06:350 Comments
// Flashing Light Prize (5) Wireless Pacing
// VijeMiller
// Relay Pin
int relay = 2;
// Serial Data
char data;
void setup() {
  Serial.begin(9600);
  pinMode(relay, OUTPUT);
}
void loop() {
  // Communication?
  if (Serial.available() > 0) {
    // Whad' It Say?!
    data = Serial.read();
    // On?
    if (data == 'F') {
      digitalWrite(relay, HIGH);
    }
    // Off?
    if (data == 'U') {
      digitalWrite(relay, LOW);
    }
  }
}

Discussions