Dr. Jack and Mr. O'Lantern
23:9.52 225-15 OTC



While carving a pleasant little pumpkin for the children to find glee and adulation, I accidentally swallowed a pumpkin seed. Laced with Nature's poison, I succumbed to it's decay as neurons tangled, my skin tensed, my blood boiled, I changed. I awoke much later to find this wretched thing before me, unaware of how I built it or why. I am cursed...or...

A rushed build for All Hallows Eve which left improvements like a more generous smoke tray, refined blower, water pump, ambient sound and FLAMES, aborted.

// Dr. Jack Mr. O'Lantern
// TVMiller

#include <Servo.h>
Servo jack;
Servo pour;

const int red = 4;
const int blue = 5;
const int fan = 2;

const int sensor = A0;
// Trigger Distance in CM
const int dist = 90;

void setup() {
jack.attach(7);
jack.write(0);
pour.attach(3);
pour.write(10);

pinMode(red, OUTPUT);
pinMode(blue, OUTPUT);
pinMode(fan, OUTPUT);

Serial.begin(9600);

digitalWrite(red, HIGH);
digitalWrite(blue, LOW);
delay(2500);
digitalWrite(red, LOW);
digitalWrite(blue, HIGH);
delay(2500);
}

void loop() {

jack.write(0);
pour.write(10);
digitalWrite(red, HIGH);
digitalWrite(blue, LOW);
digitalWrite(fan, LOW);
delay(20);
digitalWrite(red, LOW);
delay(40);
digitalWrite(red, HIGH);

long prox, proxcm;
pinMode(sensor, OUTPUT);
digitalWrite(sensor, HIGH);
delayMicroseconds(6);
digitalWrite(sensor, LOW);
pinMode(sensor, INPUT);
prox = pulseIn(sensor, HIGH);
proxcm = mtc(prox);
Serial.println(proxcm);

if (proxcm < dist) {
digitalWrite(red, LOW);
pour.write(75);
jack.write(130);
delay(100);
digitalWrite(fan, HIGH);
delay(2000);
digitalWrite(blue, HIGH);
delay(10000);
}

delay(100);
}

long mtc(long ms) {
return ms / 29 / 2;
}

Archive
HackADay.io - Dr. Jack and Mr. O'Lantern
HackADay.io - Halloween Hack List
Imgur - HackOWeen - Dr. Jack and Mr. O'Lantern
TVShow S01E08 McDuff
20:8.6 219-15 OTC


On a silent film kick; Chaplin reigns supreme.
Side note, I would not be caught kidnapped, raped and dead in a Lincoln MKAny thing

Written, Directed and Duffed by TVMiller
Guest Starring Maximus the Dog
Filmed Through Cellophane, Bat Guano and Droid Razr
Meaning of (Unimportant) Life
16:38.31 216-15 OTC
An accumulation of perspectives of experiences builds a puzzle; when the image becomes clearer, your life is defined. @TVMiller 1:24 AM - 21 Oct 2015

If it is not useful for every one, it is just art. @TVMiller 11:46 AM - 21 Oct 2015
TVShow S01E07 All Hallows Eve Special
01:27.58 216-15 OTC


Written, Directed and Defecated by TVMiller
Droid Razr HD not ZTE POS N800
FollowTV (1)
16:36.52 203-15 OTC
Frequently shifting position in my laboratory viewing solution utilizing (3) ultrasonic sensors, (3) servos, an Arduino Uno and an excessive amount of averaging (see below) to lessen interference.
(Advice) Never buy HC-SR04 sensors, blech, double blech.



// FollowTV
// TVMiller

#include <Servo.h>

const int atpin = 2;
const int aepin = 3;
const int btpin = 4;
const int bepin = 5;
const int ctpin = 6;
const int cepin = 7;

// For Cycle
const int num = 15;
int i = 0;
// Limit Distance
const int limit = 5500;
int hold = 500;

long adur, atot, afix;
long bdur, btot, bfix;
long cdur, ctot, cfix;

Servo lfs; // Left Front Speaker
const int lfsout = 69;
const int lfsin = 92;

Servo mon; // Monitor
const int monl = 145;
const int monc = 91;
const int monr = 45;

Servo rfs; // Right Front Speaker
const int rfsin = 63;
const int rfsout = 78;

void setup() {
Serial.begin(9600);

pinMode(atpin, OUTPUT);
pinMode(aepin, INPUT);
pinMode(btpin, OUTPUT);
pinMode(bepin, INPUT);
pinMode(ctpin, OUTPUT);
pinMode(cepin, INPUT);

lfs.attach(8);
mon.attach(9);
rfs.attach(10);

digitalWrite(atpin, LOW);
digitalWrite(btpin, LOW);
digitalWrite(ctpin, LOW);

lfs.write(lfsin);
mon.write(monc);
rfs.write(rfsin);

}

void loop() {

atot = 0;
for (i=0; i <= num; i++){
digitalWrite(atpin, HIGH);
delayMicroseconds(10);
digitalWrite(atpin, LOW);
adur = pulseIn(aepin, HIGH);
if (adur > limit) {
adur = limit;
}
atot = atot + adur;
}
afix = atot / num;

btot = 0;
for (i=0; i <= num; i++){
digitalWrite(btpin, HIGH);
delayMicroseconds(10);
digitalWrite(btpin, LOW);
bdur = pulseIn(bepin, HIGH);
if (bdur > limit) {
bdur = limit;
}
btot = btot + bdur;
}
bfix = btot / num;

ctot = 0;
for (i=0; i <= num; i++){
digitalWrite(ctpin, HIGH);
delayMicroseconds(10);
digitalWrite(ctpin, LOW);
cdur = pulseIn(cepin, HIGH);
if (cdur > limit) {
cdur = limit;
}
ctot = ctot + cdur;
}
cfix = ctot / num;

Serial.print(afix);
Serial.print(" ");
Serial.print(bfix);
Serial.print(" ");
Serial.println(cfix);

if (afix < bfix && afix < cfix) {
// Position 2
lfs.write(lfsout);
mon.write(monl);
rfs.write(rfsin);
}
else if (bfix < afix && bfix < cfix) {
// Position 1 and 3
lfs.write(lfsin);
mon.write(monc);
rfs.write(rfsin);
}
else if (cfix < afix && cfix < bfix) {
// Position 4
lfs.write(lfsin);
mon.write(monr);
rfs.write(rfsout);
}
else if (afix == limit && bfix == limit && cfix == limit) {
// Position Open
lfs.write(lfsout);
mon.write(monc);
rfs.write(rfsout);
}

delay(hold);
}

Archive
HackADay.io - FollowTV
Imgur - imgur.com/gallery/XbKaLmx
@HackADay - twitter.com/hackaday/status/652597228264161280