Last active
December 12, 2015 12:09
-
-
Save sampottinger/4770336 to your computer and use it in GitHub Desktop.
Example of what the Orrery Web Control logic might look like on an Arduino.
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
#include <Ethernet.h> | |
#include <HTTPClient.h> | |
#include <OrreryWebControl.h> | |
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xEF }; // MAC address for the ethernet controller. | |
OrreryWebControl webController; | |
void setup() | |
{ | |
Ethernet.begin(mac); | |
} | |
void loop() | |
{ | |
OrreryWebConfig latestWebConfig; | |
// ... other logic including something to maybe wait 3 seconds | |
webController.checkIn(&latestWebConfig, motorSpeed, motorDraw, rotations); | |
setRelayStatus(latestWebConfig.relayEnabled); // latestWebConfig.relayEnabled is of type boolean | |
setMotorSpeed(latestWebConfig.motorSpeed); // latestWebConfig.motorSpeed is of type float | |
// ... other logic | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment