Skip to content

Instantly share code, notes, and snippets.

@ivastly
Created August 30, 2020 14:42
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 ivastly/5dd012ccf8cb1abecc3ac271feb325ae to your computer and use it in GitHub Desktop.
Save ivastly/5dd012ccf8cb1abecc3ac271feb325ae to your computer and use it in GitHub Desktop.
Paper Signals Arrow Robot Custom behavior
void loop() {
SetActionLEDOn();
if (WiFi.status() == WL_CONNECTED) {
String response = mySignal.getJsonHTTP(ApiHost, "/check_this_minute_hotline.php");
Serial.println(response);
if (response == "hotline") {
SetConnectionLEDOn();
for (int i = 0; i < 10; ++i) {
if (direction) {
mySignal.MoveServoToPosition(180, 5);
direction = false;
Serial.println("forward");
} else {
mySignal.MoveServoToPosition(10, 20);
direction = true;
Serial.println("backward");
}
}
}
}
else {
SetConnectionLEDOff();
}
SetActionLEDOff();
delay(5000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment