Skip to content

Instantly share code, notes, and snippets.

@ianloic
Created November 13, 2017 18:50
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 ianloic/28197a4f4968ab5de64ad3e1939d0330 to your computer and use it in GitHub Desktop.
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
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