Evaluating Elevation | Hover


Efficient hovering at shallow elevations should be accomplished by intermittent oscillations and not static resistance; a gradual ascent and consequential decent building kinetic discharge.
TVShow S01E26X42 Fare Well Laboratory E


Written, Directed and Evicted by TVMiller
Filmed through CCTV and Droid Razr
TVShow S01E25X41 Garbage Gauge
The average American family of four creates 124 pounds of garbage each week. We are dismissive if we are better or worse. Here we have combined a Particle Photon, scale and scraps to wirelessly log our weekly and life long waste out put with coding to acclimate to blah blah blah...the following is a fart joke.



Written, Directed and Possessed by TVMiller
Filmed through Pea Soup and a Droid Razr

Particle Photon Code? Sketch? Letters and Numbers
// Garbage Gauge
// @TVMiller

#ifdef SPARK
#include "ThingSpeak/ThingSpeak.h"
#else
#include "ThingSpeak.h"
#endif

#ifdef SPARK
TCPClient client;
#define VOLTAGE_MAX 3.3
#define VOLTAGE_MAXCOUNTS 4095.0
#endif

// ThingSpeak
unsigned long myChannelNumber = CHANNEL;
const char * myWriteAPIKey = "APIKEY";

// Input
int scale = A5;

// Variables
int current = 0;
int tare = 0;
int preweight = 0;
int adjust = 0;

int week = 0;
int total = 0;

int wait = 10800; // 3 Hours

void setup() {

Serial.begin(9600);
ThingSpeak.begin(client);

// Calm Down Power-Up Fluctuation
delay(5000);

// Empty Garbage Bin Weight
tare = analogRead(scale);

delay(5000);

}

void loop() {

// Read Pot
current = analogRead(scale);
// Convert to Pounds
// Pot Turn Limitation 254 Pounds
// Particle Photon is 0 to 4095
preweight = map(current, 0, 4095, 0, 254);
// Subtract Tare
adjust = preweight - tare;

if (adjust < week && preweight < tare) {
// No Barrel? Ignore
}
else if (adjust < week && preweight > tare) {
// Barrel Emptied? Reset Week
week = adjust;
}
else if (adjust == week) {
// No Change? Ignore
}
else if (adjust > week) {
// Remove Previous Week Addition
total = total - week;
// Adjust Week
week = adjust;
// Add to Total
total = total + week;
}

// Total Amount
ThingSpeak.writeField(myChannelNumber, 1, total, myWriteAPIKey);
// Amount Since Emptying
ThingSpeak.writeField(myChannelNumber, 2, week, myWriteAPIKey);

// Low Power During Delay
System.sleep(wait);
delay(wait);
// Allow WIFI Recovery
delay(10000);
}

Archive
HackADay.io - Garbage Gauge
ThingSpeak Tutorial - ThingSpeak Particle Photon Library
TVShow S01E24X40 Squirt


Written, Directed and Disposed of by TVMiller
Filmed through Battery Acid Flavor and Droid Razr
TVShow S01E23 HackADay Maker Crown
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 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...

Written, Directed and Lobbed Scimitar by TVMiller
Filmed by a Bloody Peasant holding a Droid Razr

Arduino Nude Sketch

// 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();
Serial.print("RSSI: ");
Serial.print(rssi);
Serial.println(" dBm");
}

void updateThingSpeak(String tsData) {
if (client.connect(thingSpeakAddress, 80)) {
client.print("POST /update HTTP/1.1\n");
client.print("Host: api.thingspeak.com\n");
client.print("Connection: close\n");
client.print("X-THINGSPEAKAPIKEY: " + APIKey + "\n");
client.print("Content-Type: application/x-www-form-urlencoded\n");
client.print("Content-Length: ");
client.print(tsData.length());
client.print("\n\n");
client.print(tsData);
lastConnectionTime = millis();
}
}

void seated() {

digitalWrite(red, LOW);
digitalWrite(green, LOW);
digitalWrite(blue, HIGH);

serone.write(seatposone);
serthree.write(seatposthree);
serfive.write(seatposfive);
sersix.write(seatpossix);
sereight.write(seatposeight);

for (postwo = seatpostwoA; postwo >= seatpostwo; postwo -= 1) {
sertwo.write(postwo);
delay(sitdelay);
}
for (posfour = seatposfourA; posfour >= seatposfour; posfour -= 1) {
serfour.write(posfour);
delay(sitdelay);
}
delay(500);
for (posseven = seatpossevenA; posseven >= seatposseven; posseven -= 1) {
serseven.write(posseven);
delay(sitdelay);
}
for (posnine = seatposnineA; posnine >= seatposnine; posnine -= 1) {
sernine.write(posnine);
delay(sitdelay);
}

for (postwo = seatpostwo; postwo <= seatpostwoA; postwo += 1) {
sertwo.write(postwo);
delay(sitdelay);
}
for (posfour = seatposfour; posfour <= seatposfourA; posfour += 1) {
serfour.write(posfour);
delay(sitdelay);
}
delay(500);
for (posseven = seatposseven; posseven <= seatpossevenA; posseven += 1) {
serseven.write(posseven);
delay(sitdelay);
}
for (posnine = seatposnine; posnine <= seatposnineA; posnine += 1) {
sernine.write(posnine);
delay(sitdelay);
}
}

void rise() {

digitalWrite(red, LOW);
digitalWrite(green, HIGH);
digitalWrite(blue, HIGH);

sertwo.write(seatpostwoA);
serfour.write(seatposfourA);
serseven.write(seatpossevenA);
sernine.write(seatposnineA);

for (posone = seatposone; posone >= seatposoneA; posone -= 1) {
serone.write(posone);
delay(risedelay);
}
for (posthree = seatposthree; posthree >= seatposthreeA; posthree -= 1) {
serthree.write(posthree);
delay(risedelay);
}
for (posfive = seatposfive; posfive <= seatposfiveA; posfive += 1) {
serfive.write(posfive);
delay(risedelay);
}
for (possix = seatpossix; possix >= seatpossixA; possix -= 1) {
sersix.write(possix);
delay(risedelay);
}
for (poseight = seatposeight; poseight >= seatposeightA; poseight -= 1) {
sereight.write(poseight);
delay(risedelay);
}
state = 2;
}

void battle() {

digitalWrite(red, HIGH);
digitalWrite(green, LOW);
digitalWrite(blue, LOW);

for (posone = seatposoneA; posone <= seatposone; posone += 1) {
serone.write(posone);
delay(battledelay);
}
for (postwo = seatpostwoA; postwo >= seatpostwo; postwo -= 1) {
sertwo.write(postwo);
delay(battledelay);
}
for (posthree = seatposthreeA; posthree <= seatposthree; posthree += 1) {
serthree.write(posthree);
delay(battledelay);
}
for (posfour = seatposfourA; posfour >= seatposfour; posfour -= 1) {
serfour.write(posfour);
delay(battledelay);
}
for (posfive = seatposfiveA; posfive >= seatposfive; posfive -= 1) {
serfive.write(posfive);
delay(battledelay);
}
for (possix = seatpossixA; possix <= seatpossix; possix += 1) {
sersix.write(possix);
delay(battledelay);
}
for (posseven = seatpossevenA; posseven >= seatposseven; posseven -= 1) {
serseven.write(posseven);
delay(battledelay);
}
for (poseight = seatposeightA; poseight <= seatposeight; poseight += 1) {
sereight.write(poseight);
delay(battledelay);
}
for (posnine = seatposnineA; posnine >= seatposnine; posnine -= 1) {
sernine.write(posnine);
delay(battledelay);
}
state = 4;
}

Pebble JS App

// 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 (Change)
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');
});

Archive
HackADay.io - Maker Crown
ThingSpeak - ThingTweet Tutorial
@AtmelMakes - Tweet