Here’s a demo of the finished system:
In the end, it all turned out really well. Painting it white and using a white print stand was a good insight, the light reflects around the box pretty well for how few LEDs are in use.
The software flow chart has changed slightly. I removed the speaker as it wasn’t loud enough and added software debouching for the pushbutton interrupt service routine. Here’s that most recent version:
The interesting parts of the code are the cookResin function as well as the main loop of the Arduino:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
void loop() { digitalWrite(BUTTONLED_pin, HIGH); displayStaticState(0); if (BPRESSED == true) { cookResin(14400); } } void cookResin(unsigned long MAXTIMER){ unsigned long SECTIMER = 0; writeLCDLines("CURING TIME REM:", "H:MM:SS -:--:--"); fadeLEDs(1,1); while ((SECTIMER < MAXTIMER) && (BPRESSED)) { digitalWrite(BUTTONLED_pin, HIGH); String part0 = String("H:MM:SS "); String part1 = secToHuman(MAXTIMER - SECTIMER); String line1 = part0 + part1; lcd.setCursor(0, 1); lcd.print(line1); int DMILSECTIMER = 0; while ((DMILSECTIMER < 10) && (BPRESSED)){ digitalWrite(BUTTONLED_pin, HIGH); Alarm.delay(100); //Alarm.delay(1); DMILSECTIMER++; } SECTIMER++; } if (BPRESSED == false){ //start of cancelled cure end displayStaticState(2); fadeLEDs(0,1); delay(1000); BPRESSED = false; //end of cancelled cure end } else { //start of successful cure end displayStaticState(1); fadeLEDs(0,1); delay(1000); BPRESSED = false; //end of sec cure end } return; } |
Again, this all should all be explained by the flow chart. The full source can be found at the bottom of this post.
The circuit schematic hasn’t changed at all since this post, here’s a fritzing of what’s going on:
Super simple, basically a screen and a button. The parts to make this are here:
Assembly is super straight forward, if you’re trying to build one and have any questions, let me know!
Thanks for reading!
I copy and paste the code into my arduino and it comes up with so many errors?
What am i doing wrong?