Categories
affiliations classes and presentations consulting curriculum vitae insights instructional technology libraries open source professional activities professional experience references research interests teaching teaching experience technology workshops

John LeMasney on Hands-On Arduino

English: Photograph of an Arduino Duemilanove ...
English: Photograph of an Arduino Duemilanove (2009b Revision) PortuguĂŞs: Fotografia de um Arduino Duemilanove (RevisĂŁo 2009b) (Photo credit: Wikipedia)

The next Princeton PC Users Group meeting is August 26, 2014 at 7:00 pm at the Lawrence Branch of the Mercer County Library, New Jersey.

John LeMasney on “Hands-On Arduino”

Arduino is an electronics prototyping platform that allows you to scratch your own itch. It exemplifies the making movement, in which we are moving away from off-the-shelf solutions, and moving towards regaining a sense of how things work. Come learn how to gain a new control of the technology that we use everyday. 
Bio:
John LeMasney is a technologist, designer, and artist working in New Jersey.
( lemasney@gmail.com | 609-553-9498 | lemasney.com )
Categories
consulting curriculum vitae insights instructional technology libraries open source portfolio professional activities professional experience research interests teaching technology

Arduino Based Five Ten Egg Timer

I love the five-ten egg. It’s a hard-boiled egg that leaves the yolk just a bit soft and the outside done. Simply boil water, drop your egg, and watch your time. At 5 minutes, ten seconds, pull and ice bath the egg to stop cooking. Peel, enjoy.

I have been relearning my Arduino chops, and one of the ways that I’ve done this is by recreating the Arduino starter kit projects, including one for a digital hourglass.

I decided to repurpose the digital hourglass to light an LED each minute through five minutes, then blink the last LED for ten seconds. Here is the circuit:

Arduino Five Ten Egg Timer - John LeMasney
Arduino Five Ten Egg Timer – John LeMasney

Here is the code:

/*
Arduino Starter Kit example
Project 8 – Digital Hourglass, modified to a Five-Ten egg timer.

This sketch is written to accompany Project 8 in the
Arduino Starter Kit

Parts required:
10 kilohm resistor
six 220 ohm resistors
six LEDs
tilt switch

Created 13 September 2012
by Scott Fitzgerald

Modified 13 August 2014
by John LeMasney

Arduino Starter Kit Multi-Language

This example code is part of the public domain
*/

// named constant for the switch pin
const int switchPin = 8;

unsigned long previousTime = 0; // store the last time an LED was updated
int switchState = 0; // the current switch state
int prevSwitchState = 0; // the previous switch state
int led = 2; // a variable to refer to the LEDs

// 60000 = 1 minutes in milliseconds
long interval = 60000; // interval at which to light the next LED

void setup() {
// set all of the LED pins as outputs
for(int x = 2;x<8;x++){
pinMode(x, OUTPUT);
}
// set the tilt switch pin as input
pinMode(switchPin, INPUT);
}

void loop(){
// store the time since the Arduino started running in a variable
unsigned long currentTime = millis();

// compare the current time to the previous time an LED turned on
// if it is greater than your interval, run the if statement
if(currentTime – previousTime > interval) {
// save the current time as the last time you changed an LED
previousTime = currentTime;
// Turn the LED on
digitalWrite(led, HIGH);
// increment the led variable
// in 1 minute the next LED will light up
led++;

if(led == 6){
// the 5 minutes is up, light up fifth LED, then blink last LED for ten seconds, then leave solid.
digitalWrite(6,HIGH);
for(int b = 1;b<6;b++){
digitalWrite(7,HIGH);
delay(1000);
digitalWrite(7,LOW);
delay(1000);
}
digitalWrite(7,HIGH);
}
}

// read the switch value
switchState = digitalRead(switchPin);

// if the switch has changed
if(switchState != prevSwitchState){
// turn all the LEDs low
for(int x = 2;x<8;x++){
digitalWrite(x, LOW);
}

// reset the LED variable to the first one
led = 2;

//reset the timer
previousTime = currentTime;
}
// set the previous switch state to the current state
prevSwitchState = switchState;
}

Categories
consulting

Jack made pizza tonight for all of us. This is my personal pie with onion, cherry tomato, garlic, spinach, and fresh mozzarella on our own dough.

via Instagram https://www.instagram.com/accounts/login/?next=/p/rne7d6Li5T/
Categories
consulting

Still of the Arduino digital hourglass.

via Instagram
Categories
consulting

Arduino sketch: digital hourglass in which an initial motion switch triggers LEDs lighting up every 10 minutes.

Categories
consulting

Canoe!