Created
August 30, 2020 14:42
-
-
Save ivastly/5dd012ccf8cb1abecc3ac271feb325ae to your computer and use it in GitHub Desktop.
Paper Signals Arrow Robot Custom behavior
This file contains hidden or 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
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