This BLOG’s TABLE OF CONTENTS:
- Tommy’s Tale: Tommy meets Doofus and the Magentos Vector Door Transport
- The Tales for Makers: Gary and the MVD Transport video https://youtu.be/R7u5LiqLVFU the finished project in an entertaining short video
- The Arduino project wiring schematic
- The Arduino software
- The Arduino project flowchart
- Some build pix
Tommy’s Tale: Tommy meets Doofus and the MVD Transport
Tommy had been having a ton of fun at the amusement park even though he had somehow gotten separated from his Dad. Tommy knew his Dad would eventually find him.
Tommy had spent the whole afternoon in the game arcade. There were a lot of other friendly kids who also loved to play games. Tommy had made a friend with another 12 year old kid named Doofus.
Doofus is pretty tall for his age, a whole head taller than Tommy, sporting freckly pale skin, bright red hair in a mullet, and a big gregarious smile of huge buck teeth. Doofus liked to talk and tell goofy jokes. He is wearing a baseball cap with an LED display on the forehead above the brim that flashes “Jeenyus”. He also carries around a WRONGCO electronical joy buzzer in his hand. He likes to introduce himself to the adults, offering an adult like handshake, and double over with a loud belly laugh when they get shocked by the high voltage and startled by the obnoxious screech of the WRONGCO joy buzzer.
In the game arcade, Tommy & Doofus were both dominating at skee ball. The prize coupons for both of them are continuously spewing out the skee machines and curling into mountainous piles. They do some friendly trash talking at the skee ball machines and become gaming buddies.
Tommy and Doofus had both worked up quite an appetite. Tommy was also missing his Dad a bit. Tommy asked Doofus “Hey Doof, Im getting hungry. Want to go get some pizza ?”
“I’m with ya buddy” Doofus shouted back loudly.
First they stop by the cashier’s table to cash in all their coupon winnings for bright LED tactical torch flashlights, the ones that advertise 2 mile visibility. The torches have other little buttons with small weird symbols next to them that are hard to read. They’ll be more time later to fool with the torch flashlights.
Tommy races out of the game arcade with Doofus right by his side. The door slams shut on a couple of folks they had rushed past. Those poor folks got a face full of door and hit the old plywood floor of the arcade with a hollow dull thud. Doofus runs back to apologize and help them stand back up. You guessed it, Doofus extends a hand and shocks the athletic looking guy with the joy buzzer. The guys eye’s get real wide, his face beet red, and he looks MAD. Doofus turns tail, howling with belly laugh, runs at top speed to catch up to Tommy, grab his arm, and they zip away into the crowd.
It is starting to get to dusk, a big neon PIZZA glows with its deep red shining pepperonis off in the distance, singing its sweet song to the boys. They can smell the delicious distinctive aroma of pizza dough, bubbling cheeses, fresh basil, and pepperoni. They’re drooling by now and run to the pizza stand get the hot Italian style delicacy. The pizza stand has a couple jovial flour covered chefs whipping around the pizza dough into perfectly round and thin pie crusts. They lay the hand spun pizza dough on a rack that spits out the tomato sauce and fresh basil perfectly uniform on the pie dough in one second. The rack transports the pizza to the auto cheese station, in one second has the cheeses evenly spread without disturbing the sauce, and this whirly gig helicopter looking do-dad slices and flings out pepperoni slices precisely uniform on the pizza, again in about one second. Pizzas are in continuous production. Doofus says “ I gotta build a machine like that to do my homework”. They boys crack up.
After polishing off a couple slices of hot gooey pizza, Doofus asks Tommy “You in for some dessert ? “ Tommy scans the amusement park from where they stand, just a couple turns away, down an alley is the Funnel Cake Pavilion. Tommy excitedly yells at Doofus “ Last man at the Funnel Cakes Stand has to kiss a frog” , they both launch themselves to top speed. They wedge, twist, turn, and dodge through the maze of people, hurdling overflowed trash cans, park benches, even a couple dogs, racing as fast as they can to the Funnel Cake Pavilion.
There was a slight ocean breeze blowing. The breeze picked up a used hot dog wrapper like a kite. As the wrapper rolled, tumbled and danced across the sandy asphalt, a small garbage robot, the size of a squirrel, hidden in the shadows, snaps to attention to give it chase. Keeping trash picked up is it’s only true purpose in life. Its called a Mini Trash-bot XLS, designed and manufactured by WRONGCO, the joy buzzer people. The Mini Trash-bot XLS is drawn the movement of the wrapper like a hungry lion. Trash-bot XLS accelerates and closes in, zigging and zagging to at a fevered pace to snag that renegade hot dog wrapper.
Mini Trash-bot XLS, the hot dog wrapper, and Doofus arrive to the exact same location at the exact same time. Ooohhhhh nooooo- a catastrophic collision delivers destruction, Mini Trash-bot XLS is smashed into atoms. The paper hot dog wrapper is stuck to Doofus in a smear of relish, ketchup, and mustard. Doofus flipped head over heels, scraped his knees and tore his shorts.
An instant later, a small red flashing light and a squealing " WEE WAHHHH.......WEEWAHHH" races to Doofus's aid from out of the shadows. Its an eighteen inch high, or so, white robot with a red + sign on its front and back. It has a radar like sensor dish on top that quickly scans Doofus from top to bottom. Doofus sees the robot is conspicuously labeled " AMUSEMENT PARK FIRST AID". It draws near Doofus, sprays antiseptic on his scraped knees, then sprays some goop on top of the wounds that quickly dries as a flexible bandage. The First Aid Robot then turned off its lights and scurries back into the shadows, mission complete. Doofus shakes off the bumps and bruises from his unfortunate spill, stands up, dusts off his clothes and quickly continues on his quest to catch up with Tommy at the Funnel Cake Pavilion.
Funnel Cake Pavilion
Tommy won the race this time. He scans the area. Funnel Cake Pavilion looks different than the rest of the amusement park. Gone are the bright white colors of the overpainted weather beaten wooden buildings. There are no smells of ancient pine and redwood. Funnel Cake Pavilion is stainless steel. Stainless steel building. Stainless steel picnic tables. Stainless steel menus. Stainless steel plates. Some of the picnic tables were really small. Some of the picnic tables were really big, Doofus says “like gi-mungus big. Makes the Shaq look little“ Stainless steel control panels with bright colored lights and high definition touchscreens are everywhere at Funnel Cake Pavilion.
The funnel cake flavors are strange too. Cactus, octopus, opossum, and armadillo funnel cakes are on the menu. The toppings are kind of strange too….machine oil, choco-plankton, wolfbane powder……Tommy asks Doofus “ you want some belly button fuzz flavored funnel cake ? “ Doofus replies “ewwwwwwwww. No doo-dee flavors for me. “ The guys both fall over laughing. They order regular funnel cakes with powdered sugar on top. Doofus says “Now that’s a yummy funnel cake.” Tommy agrees “these are awesome”. Scanning the area while they eat, Tommy asks Doofus “How about something to drink ? “ Doofus replies “ fer sure buddy, I wish we didn’t have to make a special trip for drinks, but I am thirsty. I could go for an ice cold ice cream float or milk shake” Tommy shouts “ Lets dooooooo it !!!!!!!!” they both take off running without knowing the way there.
The Carousel
Doofus is running top speed to keep up with Tommy. On a full belly of pizza, he can no longer catch his breath. He stops running, doubles over, drops on one knee and shouts out in a raspy voice “Time out. Wait up”.
Tommy retreats to meet back with his friend. “Doof – you wearing lead sneakers ? ” Doofus huffed out a reply in between gasps for air “That last slice of pizza is really slowing me down”.
Just then the boys get a deafening blast of the happy calliope music coming from a carousel nearby. Doof says” hey Tommy lets check it out.” “OK” says Tommy.
Approaching the carousel, it is brightly colored, circled with magnificent prancing horses. The carousel has a grand mechanical band in the center. The boys stare astonished, taking mental notes of the mechanical symphony. The huge calliope, with what seems a hundred pipes, two huge bass drums, a couple snare drums, tom-toms, cymbals, are all driven by an invisible force turning a big flywheel in the center. The centerweel has gearboxes and shafts sticking out at all angles and directions like a big scared porcupine. Each of those shafts have more wheels, leather belts, old worn greasy gears, tireless turning the calliope, ultimately generating the special foot tapping tooty tunes that makes everyone smile.
Now Tommy’s attention is shifted to the carousel horses.
In Wisconsin, Tommy had a class on horses at the school's farmers club. He took pride in identifying horse breeds. Coming around the corner on the carousel, Tommy views a stately and proud beautiful white unicorn. Next is a muscular Arabian Steed, the mane arranged in braids, beautiful Arabian style blankets under the saddle. The tack and blankets look so realistic. Another horse prances by, this one a gorgeous Pinto. A Painted Horse and a dapple gray Appaloosa follow, they are outfitted with western looking blankets, saddles, and side bags. Around and around they go, always returning to pass by again.
These carousel horses look amazingly lifelike, they almost seem to move. Tommy points over to the horses and shouts to Doofus “ See that ? I swear the ears moved. The tails are wagging. The horses look like they’re breathing. “ Doofus says “ Tommy, you are crazy like a circus clown”
Each horse is tethered to a chariot. The chariots match the theme and style of each horse. Some wheels are spoked, some are solid, some with rubber tires, others with wood covered metal. Each chariot is exquisitely sculpted and painted. The colors are all neon bright , sparkly, and eye catching.
The carousel starts it’s next ride, slowly lurches counterclockwise. The calliope pipes start screaming out Colonel Bogey. The drums are booming, cymbals crashing. Doofus gets a crazed wild look in his eye and hops aboard the carousel.
Doofus jumps up into the Painted Horse’s saddle, starts whooping like a cowboy riding a bucking bronco. “YEEEEEEEHAWWWWWW” He is smacking the reins on the horse’s hindquarters like the carousel will respond to his commands. Doofus kicks his imaginary spurs into the horse’s ribs every time its goes up and down. Tommy hops aboard the carousel as well, not quite so dramatically as Doofus.
Tommy is riding Pegasus, imagining he is sailing high above the amusement park, a warm ocean breeze blowing through his hair. Pegasus then starts to slowly extend and flap it’s wings ! REALLY !! Pegasus lifts up his head, bobs his nose up & down a couple times, snorts, then opens his mouth for a triumphant whinney.
Tommy is speechless. The carousel horses are animatronic. This carousel ride is so amazing.
As the ride slows down to let riders off, Tommy notices the chariots. Each horse has a chariot behind it, supposedly for seating the younger kids or adults who don’t want to ride in a saddle on the horses back.
The chariot’s seats do not face forward, they oddly face backward. The chariot riders see passing scenes, not approaching scenery, and are looking square into the face of the horse behind them.
Tommy climbs into the chariot seat out of curiosity, and Doofus slides in next to him to not miss in any fun. They closely inspect the horse face starting right at them. Doofus and Tommy both run their hands over the smooth horse head, feeling for cracks and seams, anything to gain a look to see how the animatronics work. Doofus then slaps the horse head on the side, giggling, then shouting “ya old nag”.
YOW !!! Both boys almost pee their pants. The horse’s eyes light up a hellish deep red and the horse starts to talk in a cold mechanical voice. “Equipment assault will not be tolerated, please consider this as your only warning.” The horse continues “Facial recognition has identified you as young Mr. Doofus. Mr. Doofus, your parents have requested you to meet them at the game arcade security office immediately.” Doofus starts to studder in disbelief. In a panicked jittery voice “ Ohhhhhh noooooo. I forgot about them. I. am. In. deep. DEEP. trouble. See ya Tommy”.
Doofus pivots, slides out of the chariot seat, stands outside the carousel fence for a second, surveying the park, snapping his head back and forth, 180 degrees to get his bearings. From above, Doofus all of a sudden gets a growing louder buzz approaching his head. He ducks and a big drone just barely misses clipping one of his ears. That was a close call ! Crap, the U.F.O. did a 180 flip upside down, and charged right back at his head, glaring with all lights on.
The close flyby was from one of the park’s big eight rotor security drones. This drone is a nasty sheep dog drone from their drone fleet. The black drone is fairly stealth for something with that much rotor power. It was out to herd Doofus back to the game arcade security office pronto. Doofus certainly didn’t appreciate the sheep dog drone’s help, but the park drone fleet had some other even nastier drones, Doofus didn’t want to antagonize park security and his parents any more.
Tommy is left sitting there, mind blank, stunned by the actions that just transpired. He gathers himself, looks to the horse and asks “Mr Horse, where is my Dad, Ray Badmington ?
The animatronic horse replies “working………….there is no Ray Badmington in photo records, surveillance video, or in location requests. “
Tommy asks “can I leave a recorded message for Ray Badmington if he is detected ? “ The animatronic horse replies “working………….there is no Ray Badmington in photo records, surveillance video, or in location requests. “
Tommy thinks for a minute and asks “can you take my picture, label as Tommy Badmington, and save in the cloud records ? ” The animatronic horse replies “affirmative. Please hold still for 20 seconds”
The horse’s eyes change colors, starting from a from a deep red, then to yellowish then white, and then blue and violet lights. The horse then speaks again “ audio and video clip data is recorded and stored to the security data cloud. Thank you for visiting BDTH6159 Amusement Park.”
The animatronic horse eyes start to dim, then Tommy speaks out again “ Please Mr Horse, how can I quickly get back to the entrance of the amusement park ? “
The animatronic horse eyes light back up again, and the animatronic horse replies “ BDTH6159 Amusement Park provides convenient transport stations located outside of restroom facilities. Please refer to the park map at pathway intersections”.
The animatronic horse eyes dim to black, goes to sleep, and the carousel starts to move counterclockwise, this time the calliope starts playing “Hotel California”. It’s kind of a weird tune to hear on a calliope especially given the circumstances, but the drums are awesome.
Tommy is getting tired of walking, but the park crowds are increasing as the dusk turns into night, so Tommy pushes on. The park lights are so colorful and bright, the music and park noise seems to have gotten even louder. Tommy finds the restrooms on the map, he starts moving that direction.
The map shows a transport station on the north side of the restrooms. Tommy circles the area several times. Even tho the park is almost as bright as day, Tommy pulls out the new torch flashlight he won playing skee ball .The added light helps him to find that restroom sign.
There is a telephone pole in front of the restrooms. There is a sign on that pole that says TRANSPORT, but Tommy doesn’t see a bench, tickets, road, or any ground markings that indicate a bus, car, carriage, golf cart, or anything with wheels has been there for transportation.
Tommy walks closer to the telephone pole where the transport sign is to get a closer look. He is getting tired, wants to find his Dad, and get some rest.
There is a small box on the telephone pole. It is mainly noticeable from afar by an occasional flash of purplish light on its front.
As Tommy approaches the Victorian era styled box, he can start to make out some of the details. The tarnished and weathered brass box hangs by the hook on its top. The box has a lighted circle on front which now slowly flashes a dimly lit yellowish glow as Tommy approaches.
The lighted circle flashes faster and gets brighter as he gets closer to it. The circle light on the front transitions to green as the yellow fades out, and continues to get brighter as Tommy walks towards the strange rusty red box inside the brass housing.
Now standing directly in front of the Victorian brass and red box, he inches closer to the strange box 's rusty and moldy red front panel for a thorough inspection. The circle of light abruptly turns blue with a small light orbiting a dark opening in the light's center. Tommy sees the small dark opening is some type of pushbutton recessed inside the light circle's donut hole center. The button is labeled in very small white print "Press Here".
While the blue light orbits the pushbutton, the box starts speaking ! The brass & red box keeps repeating “Press the button to launch the Magentos Vector Door”
“Press the button to launch the Magentos Vector Door”
“Press the button to launch the Magentos Vector Door”
Tommy is creeped out by the unemotional monotone mechanical voice. Tommy is getting cold feet, he slowly backs away and the light circle on the box fades in intensity, and changes from green to yellow.
Poor Tommy, he grows more weary and unsettled as the sky darkens to night.
He has to do something if he wants to rescue his lost dad.
Tommy gathers up his bravado and says to himself "Tommy Badmington, you can do this. You are from Wisconsin ........ Wisconsin's state's motto is FORWARD ! Forward is where you must go." Tommy breaks out a big smug grin and feels re energized. He turns and approaches the box again.
As before, Tommy approaches the box, a circle on front dimly lights yellow, and gets brighter as he gets closer. The circle on front transitions to green as the yellow fades out, as before, and continues to get brighter as he walks towards the box.
Standing directly in front of the rusty box, the light circle again turns blue with a small light orbiting a small pushbutton in the light's center. The box again is repeating “Press button to launch the Magentos Vector Door” “Press button to launch the Magentos Vector Door”
Tommy reaches out hesitantly, his index finger extended to push that button, but stops just short of touching it. He takes a deep breath, squints his eyelids shut, licks his lips, and touches the pushbutton center of the lighted circle on the box.
The box then shouts “ALERT "
"MAGNETO Power on"
"vector's phase SEQUENCE complete" ..................
"Acknowledge Magentos Vector Door Target Sequence”
The red box's circle lights burn a bright blinding red, flashing faster and faster as the Magentos Vector Door precharge builds up for the final activation.
The circle lights changes to a even more blinding white light and fires off like an antique camera's flash pan powder,
........... and now Tommy is gone.
The red box's lighted circle is a dim red again, slowly fading out to nothingness like dying campfire embers.
The brass and red box then says “Magentos Vector Door Target Sequence COMPLETE” Tommy is transported…………….but where did he go ?
The brass and red box again winks occasionally with purplish blip to let folks know the MVD Door is active and ready to transport another park guest.
2. The Tales for Makers: Gary and the MVD Transport video https://youtu.be/R7u5LiqLVFU the finished project in an entertaining short video of the WrongCo Magnetos Vector Door Transport device
3. The WrongCo Magentos Vector Door Transport device wiring schematic
/*
* TalkieVocabularyDemo.cpp
* Based on the Talkie library. https://github.com/going-digital/Talkie.
* Copyright 2011 Peter Knight Copyright (C) 2018 Armin Joachimsmeyer armin.joachimsmeyer at gmail.com
* TalkieVocabularyDemo.ino is part of Talkie_new https://github.com/ArminJo/Talkie_new.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
*
*
* NeoPixel Ring simple sketch (c) 2013 Shae Erisson
* released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library
*/
// DRAFT REV2 changed DI2 PB input to be an interrupt
// added function PressedButtonTalkie, LEDS_OFF and PressButtonTalkie
// REV 3 - add RANDOM LED COLOR function and Distance/PING based LED color
//Rev 4 - create function LEDS_LongRange_COLOR_PULSE & use instead of RANDOM LED COLOR function, PressButtonTalkie triggers at 18 inches,
#include <Arduino.h>
// NEOPIXEL STUFF
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
// Which pin on the Arduino is connected to the NeoPixels?
#define PIN 6
// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS 16
// When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.
// Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest
// example for more information on possible values.
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
int delayval = 25; // delay for half a second
/// Talkie stuff
#include "Talkie.h"
#include "Vocab_US_Large.h"
int WordDelay=30;
Talkie voice;
int ButtonPressed = false;
// pinging VARs
unsigned long Pingmicroseconds =0;
unsigned long PingDistanceInches =0;
int PreviousPingDistanceInches;
int pos = 0; // variable to store the servo position
unsigned int Ping_cm; // ping distance in cm
int loopNR=0; // generic register for loops
int i=0; /// VARS for loops
int j=0; // VARs for loops
int k=0; /// VARS for loops
void setup() {
// voice.doNotUseUseInvertedOutput();
#if defined(CORE_TEENSY)
pinMode(5, OUTPUT);
digitalWrite(5, HIGH); //Enable Amplified PROP shield
#endif
Serial.begin(9600); // for troubleshooting
// pinMode(2, INPUT); // this is the capacitive pushbutton input
pinMode(4,INPUT); // Ping echo pin
pinMode(5,OUTPUT); // Ping trigger pin
digitalWrite(5, LOW);
randomSeed(analogRead(0)); // for the random color pulse funtion
pixels.begin(); // This initializes the NeoPixel library.
/// !!!!! This is what makes the DI2 pushbutton work !!!!!!
attachInterrupt(digitalPinToInterrupt(2), ButtonPressedTalkie , RISING); //DI2 to trigger interrupt on rising edge to play the trigger routine
}
void PressButtonTalkie () // Please Press the button to launch the Magnetos Vectors Door
{
LEDS_OFF();
//// start LEDS meteor sequence
for ( int x=1; x<3; x++)
{
for(int i=0;i<NUMPIXELS;i++) //This lights LED#i full bright, (LED#i-1) half bright, (LED#i-2)
{
LEDS_OFF();
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
pixels.setPixelColor(i, pixels.Color(0,150,150)); // RED.
////sets up the trailing LED values
if (i==0)
{
(j= 15); }
else
{ (j =(i-1));
}
////sets up the 2nd trailing LED
if (i==0)
{
(k= 14); }
else
{ (k =(i-2)) ;
}
if (i==1)
{
(k= 15); }
else
{ (k =(i-2));
}
pixels.setPixelColor(j, pixels.Color(0,50,50)); // RED.
pixels.setPixelColor(k, pixels.Color(0,5,5)); // RED.
pixels.show(); // This sends the updated pixel color to the hardware.
delay(2); // Delay for a period of time (in milliseconds).
}
}
// set the LED ring to a solid color while the TALKIE PLAYS
for(int i=0;i<NUMPIXELS;i++)
{
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
pixels.setPixelColor(i, pixels.Color(0,100,100)); // Moderately bright green color.
pixels.show(); // This sends the updated pixel color to the hardware.
delay(3); // Delay for a period of time (in milliseconds).
}
///// the TALKIE PART
voice.say(sp4_PLEASE); //SP4
delay (WordDelay);
voice.say(sp2_PRESS); //SP2
delay (WordDelay);
voice.say(sp2_BUTTON); //SP2
delay (WordDelay);
voice.say(sp4_TO); //sp4
delay (WordDelay);
voice.say(sp5_LAUNCH); //sp5
delay (WordDelay);
voice.say(sp3_THE);
delay (WordDelay);
voice.say(sp5_MAGNETOS);//sp5
delay (WordDelay);
voice.say(sp4_VECTORS);//sp4
delay (WordDelay);
voice.say(sp5_DOORS); //sp5
delay (WordDelay);
LEDS_OFF();
//// start LEDS meteor sequence
for ( int x=1; x<4; x++)
{
for(int i=0;i<NUMPIXELS;i++) //This lights LED#i full bright, (LED#i-1) half bright, (LED#i-2)
{
LEDS_OFF();
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
pixels.setPixelColor(i, pixels.Color(0,150,150)); // RED.
////sets up the trailing LED values
if (i==0)
{
(j= 15); }
else
{ (j =(i-1));
}
////sets up the 2nd trailing LED
if (i==0)
{
(k= 14); }
else
{ (k =(i-2)) ;
}
if (i==1)
{
(k= 15); }
else
{ (k =(i-2));
}
pixels.setPixelColor(j, pixels.Color(0,50,50)); // RED.
pixels.setPixelColor(k, pixels.Color(0,5,5)); // RED.
pixels.show(); // This sends the updated pixel color to the hardware.
delay(2); // Delay for a period of time (in milliseconds).
}
}
LEDS_OFF();
delay(1000);
}
void ButtonPressedTalkie () // ALERT(2) START(3) MAGNETOTS(5) Power(2) on(2) vectors(4) phase(2) SEQUENCE(4) complete(2) GO(2)
{
LEDS_OFF();
for(int i=0;i<NUMPIXELS;i++)
{
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
pixels.setPixelColor(i, pixels.Color(10,50,50)); // Moderately bright green color.
// pixels.show(); // This sends the updated pixel color to the hardware.
delay(5); // Delay for a period of time (in milliseconds).
}
pixels.show(); // This sends the updated pixel color to the hardware.
voice.say(sp2_ALERT); //SP4 Acknowledge Magentos Vector Door Target Sequence - Magentos Vector Door Target Sequence COMPLETE
delay (WordDelay);
voice.say(sp5_MAGNETOS); //SP2
delay (WordDelay);
voice.say(sp2_POWER); //SP2
delay (WordDelay);
voice.say(sp2_ON); //sp4
delay (WordDelay);
delay (WordDelay);
voice.say(sp4_VECTORS); //sp5
delay (WordDelay);
voice.say(sp2_PHASE);
delay (WordDelay);
voice.say(sp4_SEQUENCE);//sp5
delay (WordDelay);
voice.say(sp4_READY);//sp4
delay (WordDelay);
////// start RED LED PULSING
delay(200);
LEDS_OFF();
for (int x=1;x<8;x++)
{
for(int i=0;i<NUMPIXELS;i++)
{
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
int RED_UP=(x*20);
pixels.setPixelColor(i, pixels.Color(RED_UP,0,0)); // Moderately bright green color.
//pixels.show(); // This sends the updated pixel color to the hardware.
delay(10); // Delay for a period of time (in milliseconds).
}
pixels.show(); // This sends the updated pixel color to the hardware.
delay(x*20);
LEDS_OFF();
delay(200-(x*17));
}
///// flash LEDS white then dim to Red
for (int x=1;x<7;x++)
{
for(int i=0;i<NUMPIXELS;i++)
{
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
pixels.setPixelColor(i, pixels.Color(200,200,200)); // Moderately bright green color.
//pixels.show(); // This sends the updated pixel color to the hardware.
delay(10); // Delay for a period of time (in milliseconds).
}
pixels.show(); // This sends the updated pixel color to the hardware.
delay(1000/(2*x));
LEDS_OFF();
delay(100/(2*x));
}
// dim to red
for (int x=1;x<16;x++)
{
for(int i=0;i<NUMPIXELS;i++)
{
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
int DimRed = (30-(x*2));
pixels.setPixelColor(i, pixels.Color(DimRed,0,0)); // Moderately bright green color.
//pixels.show(); // This sends the updated pixel color to the hardware.
delay(5); // Delay for a period of time (in milliseconds).
}
pixels.show(); // This sends the updated pixel color to the hardware.
delay(30);
//LEDS_OFF();
//delay(100/(2*x));
}
LEDS_OFF();
delay (1000);
//// finish cycle statement
voice.say(sp5_MAGNETOS);//sp5
delay (WordDelay);
voice.say(sp4_VECTORS);//sp4
delay (WordDelay);
voice.say(sp5_DOORS); //sp5
delay (WordDelay);
voice.say(sp5_DEPARTURE); //sp5
delay (WordDelay);
voice.say(sp5_CYCLE); //sp5
delay (WordDelay);
voice.say(sp2_COMPLETE);//sp4
delay (WordDelay);
delay(2000);
}
void PING ()
{
digitalWrite(5, HIGH); // HC-SR04 pulse high TRIGGER
delayMicroseconds(10); // pauses for 10 microseconds
digitalWrite(5, LOW); // sets the TRIGGER pin off
// ECHO PIN measure microseconds taken to hear pulse, third number is wait time in microseconds( unsigned long int 0 to 4,294,967,295)
Pingmicroseconds = pulseIn(4, HIGH, 23458);
PingDistanceInches = (Pingmicroseconds/149); //formula from HC-SR04 spec sheet , assume solution is an integer
// max range of HC SR04 is 4m i.e. 157 inches 11,279 microseconds
if (PingDistanceInches==0){PingDistanceInches = 160;} //just for troubleshooting
// 340 meters/ second * (39.37 inches per meters) =13385. inches per usec = .0133856 inches per microsecond;; 74.7 usecs/inch , multiply by 2 for send/return path
// test and debug
Serial.print("PingDistance=");
Serial.print(PingDistanceInches);
Serial.print("inches ");
Serial.println();
}
void LED() {
// For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one.
for(int i=0;i<NUMPIXELS;i++)
{
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
pixels.setPixelColor(i, pixels.Color(25,50,25)); // Moderately bright green color.
pixels.show(); // This sends the updated pixel color to the hardware.
delay(delayval); // Delay for a period of time (in milliseconds).
}
for(int i=0;i<NUMPIXELS;i++)
{
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
pixels.setPixelColor(i, pixels.Color(0,0,0)); // Moderately bright green color.
pixels.show(); // This sends the updated pixel color to the hardware.
delay(delayval); // Delay for a period of time (in milliseconds).
}
}
void LEDS_OFF() {
// For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one.
for(int i=0;i<NUMPIXELS;i++)
{
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
pixels.setPixelColor(i, pixels.Color(0,0,0)); // Moderately bright green color.
// pixels.show(); // This sends the updated pixel color to the hardware.
delay(5); // Delay for a period of time (in milliseconds).
}
pixels.show(); // This sends the updated pixel color to the hardware.
}
void LEDS_RANDOM_COLOR_PULSE()
{
LEDS_OFF();
int RandomRed= random(200);
int RandomGreen = random(200);
int RandomBlue = random(200);
for(int i=0;i<NUMPIXELS;i++)
{
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
pixels.setPixelColor(i, pixels.Color(RandomRed,RandomGreen,RandomBlue)); // Moderately bright green color.
// pixels.show(); // This sends the updated pixel color to the hardware.
delay(5); // Delay for a period of time (in milliseconds).
}
pixels.show(); // This sends the updated pixel color to the hardware.
delay(1000);
LEDS_OFF();
delay(2000);
}
void LEDS_LongRange_COLOR_PULSE()
{
LEDS_OFF();
for(int i=0;i<NUMPIXELS;i++)
{
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
pixels.setPixelColor(i, pixels.Color(75,0,75)); // Moderately bright green color.
// pixels.show(); // This sends the updated pixel color to the hardware.
delay(5); // Delay for a period of time (in milliseconds).
}
pixels.show(); // This sends the updated pixel color to the hardware.
delay(500);
LEDS_OFF();
delay(4000);
}
////// THIS IS THE PROGRAM !! minus the interrupt
void loop() {
PING();
if ( PingDistanceInches <=18 )
{ PressButtonTalkie(); }
if ( PingDistanceInches >155 )
{ LEDS_LongRange_COLOR_PULSE();}
if (( PingDistanceInches >18 )&& ( PingDistanceInches <=155 ))
{
for(int i=0;i<NUMPIXELS;i++)
{
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
pixels.setPixelColor(i, pixels.Color(PingDistanceInches,(abs(180-PingDistanceInches)), 0 )); //color based on distance
// pixels.show(); // This sends the updated pixel color to the hardware.
delay(5); // Delay for a period of time (in milliseconds).
}
pixels.show(); // This sends the updated pixel color to the hardware. Show Pixels after the colors are set in all LEDS
delay(PingDistanceInches);
LEDS_OFF();
delay(PingDistanceInches/2);
}
delay (500);
}
One of my design targets is to map the Arduino IO so the standard Arduino IDE Examples can be loaded to test as is, troubleshooting the hardware without modifying the example code.
use IDE Example Library AdaFruit NeoPixel / simple for the NeoPixel testing – Arduino Pin D6 to ground
use IDE Example Library Talkie/TalkieVocabularyDemo Arduino Pin D11 to ground
use IDE Example Library Button Arduino Pin D2 as a 5V input from a normally open pushbutton
My own Ping code is used rather the standard examples, wiring D4 trigger D5 ECHO
Some Build pix
: