Skip to content

Instantly share code, notes, and snippets.

@sampottinger
Last active December 12, 2015 12:09
Show Gist options
  • Save sampottinger/4770336 to your computer and use it in GitHub Desktop.
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.
#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