Nine servos parade the acrylic molded crown, affixed in an arrayed scheme plotted by the Arduino MKR1000. A seated position is the first form, a calm but present light shone. When your Grace rises and depresses a button on his Pebble Classic, a second nobler form takes shape and a tweet is consigned notifying the peasants and Lords to bow their heads in reverence. Conflict arises, the crown must amend to suit an embattled King, the third form protective and fierce; another tweet is dispatched, protect your King!
// Seat Positions int seatposone = 180; // Long int seatposoneA = 150; int seatpostwo = 10; // Short int seatpostwoA = 70; int seatposthree = 130; // Long int seatposthreeA = 85; int seatposfour = 0; // Short int seatposfourA = 45; int seatposfive = 1; // Long int seatposfiveA = 40; int seatpossix = 170; // Long int seatpossixA = 130; int seatposseven = 7; // Short int seatpossevenA = 35; int seatposeight = 170; // Long int seatposeightA = 125; int seatposnine = 7; // Short int seatposnineA = 45;
// Seat Place Holders int posone = seatposone; int postwo = seatpostwo; int posthree = seatposthree; int posfour = seatposfour; int posfive = seatposfive; int possix = seatpossix; int posseven = seatposseven; int poseight = seatposeight; int posnine = seatposnine;
// Delays int sitdelay = 20; int risedelay = 15; int battledelay = 5;
// LED int red = 11; int green = 12; int blue = 10;
// State int state = 0;
// WiFi char ssid[] = "NETWORK"; char pass[] = "PASSWORD"; int keyIndex = 0; int status = WL_IDLE_STATUS; WiFiServer server(80);
// WIFI Connection while ( status != WL_CONNECTED) { Serial.print("Connecting Network: "); Serial.println(ssid); status = WiFi.begin(ssid, pass); delay(5000); } server.begin(); printWifiStatus(); }
void loop() {
// Pebble WIFI Coms WiFiClient client = server.available(); if (client) { String currentLine = ""; while (client.connected()) { if (client.available()) { char c = client.read(); Serial.write(c); if (c == '\n') { if (currentLine.length() == 0) { client.println("HTTP/1.1 200 OK"); client.println("Content-type:text/html"); break; } else { currentLine = ""; } } else if (c != '\r') { currentLine += c; }
if (currentLine.endsWith("GET /R")) { state = 1; } if (currentLine.endsWith("GET /B")) { state = 3; } if (currentLine.endsWith("GET /S")) { state = 0; } } } client.stop(); }
// Serial Input (Testing) if (Serial.available()) { char ser = Serial.read(); switch (ser) { case '0': state = 0; break; case '1': state = 1; break; case '2': state = 3; break; } }
// State Change if (state == 1) { rise(); String kingpos = String(state, DEC); updateThingSpeak("field1=" + kingpos); } else if (state == 2) {
var UI = require('ui'); var ajax = require('ajax'); var Vector2 = require('vector2');
// Create Window var main_window = new UI.Window();
// Open Button and Display var txtOnLabel = new UI.Text({ position: new Vector2(0, 15), size: new Vector2(144, 30), font: 'Gothic 28 Bold', text: 'RISE', textAlign: 'center', color: 'white' });
//this is going to be our off button var txtOffLabel = new UI.Text({ position: new Vector2(0, 95), size: new Vector2(144, 30), font: 'Gothic 28 Bold', text: 'BATTLE', textAlign: 'center', color: 'white' });