Close
0%
0%

HackADay Arduino Maker Crown

Rise For Your King

Similar projects worth following
You will hence forth address me as your Grace.

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!

Built entirely from refuse aside from the donated Arduino MKR1000

Notation - Much stood against I in this attempted episode that the artifactual quality is as consequence of surrender I shall avoid admitting to directly. My kingdom for a green screen and light box...and 3D printer and CNC and...


How To - ThingSpeak and Twitter

http://www.mathworks.com/help/thingspeak/thingtweet-app.html?requestedDomain=www.mathworks.com

  • 1 × Arduino MKR1000
  • 9 × Servo
  • 3 × TIP120 Discrete Semiconductors / Power Transistors and MOSFETs
  • 1 × 5V Regulator
  • 1 × RGB LED Strip

View all 10 components

  • ThingSpeak ThingTweet

    Vije Miller03/28/2016 at 16:40 0 comments

    Having cut the Maker Crown tweets from the video, to summarize, when you change the condition of the crown, it sends a tweet to the masses based on the state. The Arduino MKR1000 sends an update to a ThingSpeak channel where the state of the crown is stored as a numeral (0 through 4) and using ThingTweet addon, when the channel equals a certain condition (state 1 or 3) then it sends a tweet with a specific message.

  • Pebble JS App

    Vije Miller03/23/2016 at 09:37 0 comments

    // Maker Crown Peddle APP (Version 1.0) @TVMiller 
    
    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'
    });
    
    main_window.backgroundColor('black');
    main_window.add(txtOnLabel);
    main_window.add(txtOffLabel);
    main_window.show();	
    
    // URL To MKR1000
    function Toggle(function_name){
      var URL = 'http://192.168.1.9/' + function_name;
    
      ajax(	
        {
          url: URL,
          method: 'post',	
          type: 'json',
          data: { "args": function_name}
        }
      );
    }
    
    
    // Rise
    main_window.on('click', 'up', function() {
      Toggle('R');
    });
    // Battle
    main_window.on('click', 'down', function() {
      Toggle('B');
    });
    // Seated
    main_window.on('click', 'select', function() {
      Toggle('S');
    });
    

  • Arduino MKR1000 Sketch

    Vije Miller03/23/2016 at 08:48 0 comments

    // Maker Crown @TVMiller
    
    #include <Servo.h>
    #include <SPI.h>
    #include <WiFi101.h>
    
    // Servos
    Servo serone;
    Servo sertwo;
    Servo serthree;
    Servo serfour;
    Servo serfive;
    Servo sersix;
    Servo serseven;
    Servo sereight;
    Servo sernine;
    
    // 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);
    
    // ThingSpeak
    char thingSpeakAddress[] = "api.thingspeak.com";
    String APIKey = "APIKEY"; // API
    const int updateThingSpeakInterval = 100 * 1000; // Interval
    long lastConnectionTime = 0;
    boolean lastConnected = false;
    WiFiClient client;
    
    void setup() {
    
      Serial.begin(9600);
    
      // Servos Short
      sertwo.attach(2);
      serfour.attach(4);
      serseven.attach(7);
      sernine.attach(9);
    
      // Servos Long
      serone.attach(1);
      serthree.attach(3);
      serfive.attach(5);
      sersix.attach(6);
      sereight.attach(8);
    
      // Lights
      pinMode(red, OUTPUT);
      pinMode(green, OUTPUT);
      pinMode(blue, OUTPUT);
    
      serone.write(seatposone);
      sertwo.write(seatpostwoA);
      serthree.write(seatposthree);
      serfour.write(seatposfourA);
      serfive.write(seatposfive);
      sersix.write(seatpossix);
      serseven.write(seatpossevenA);
      sereight.write(seatposeight);
      sernine.write(seatposnineA);
    
      digitalWrite(red, HIGH);
      delay(500);
      digitalWrite(red, LOW);
      digitalWrite(green, HIGH);
      delay(500);
      digitalWrite(green, LOW);
      digitalWrite(blue, HIGH);
      delay(500);
      digitalWrite(blue, LOW);
    
      // 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) {
    
      }
      else if (state == 3) {
        battle();
        String kingpos = String(state, DEC);
        updateThingSpeak("field1=" + kingpos);
      }
      else if (state == 4) {
    
      }
      else {
        seated();
        String kingpos = String(state, DEC);
        if (millis() - lastConnectionTime > updateThingSpeakInterval) {
          updateThingSpeak("field1=" + kingpos);
        }
      }
    
    }
    
    void printWifiStatus() {
      Serial.print("SSID: ");
      Serial.println(WiFi.SSID());
      IPAddress ip = WiFi.localIP();
      Serial.print("http://");
      Serial.println(ip);
     long rssi = WiFi.RSSI();
    ...
    Read more »

  • Fritz ...but Simmons floats my boat

    Vije Miller03/10/2016 at 10:35 0 comments

  • Skullen Form

    Vije Miller03/10/2016 at 10:33 0 comments

View all 5 project logs

Enjoy this project?

Share

Discussions

davedarko wrote 11/04/2016 at 15:24 point

Great stuff!

  Are you sure? yes | no

Vije Miller wrote 11/05/2016 at 21:28 point

Fair warning, having a crown does not entitle you to act like a king and make demands of your subjects...I know that now. I...I know that now.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates