Created
November 13, 2017 18:50
-
-
Save ianloic/28197a4f4968ab5de64ad3e1939d0330 to your computer and use it in GitHub Desktop.
Adafruit Feather Sketch for sending a reset signal to an Intel NUC using a Non-Latching Relay Featherwing with signal on A2
This file contains 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
int SIGNAL = A2; | |
void setup() { | |
// start serial port at 9600 bps and wait for port to open: | |
Serial.begin(9600); | |
while (!Serial) { | |
; // wait for serial port to connect. Needed for native USB port only | |
} | |
Serial.println("hello."); | |
pinMode(SIGNAL, OUTPUT); | |
digitalWrite(SIGNAL, LOW); | |
} | |
void loop() { | |
if (Serial.available() > 0) { | |
int b = Serial.read(); | |
if (b == 'r') { | |
Serial.println("resetting..."); | |
digitalWrite(SIGNAL, HIGH); | |
delay(1000); | |
digitalWrite(SIGNAL, LOW); | |
Serial.println("reset."); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment