20260307 GROK conversion of the PICAXE BASIC to ARDUINO ATTINY85 added
20120701
I plan on using the existing color LEDs and battery pack and using a PICAXE to monitor the ambient temperature at some set interval... let's say that the uC wakes up every minute, samples the temperature, and then uses one of the LEDs to flash the Morse Code numeric digit. The "tens" digit will be the color used to flash... for inside use to cover a range of 40F-90F there would be 40-49, 50-59, 60-69, 70-79, and 80-89 or five (5) LEDs. The advert says 8 colors but my limited playing suggests that more than one LED is on for some colors and to minimize battery drain and current limiting and all that stuff, I only will be using individual LEDs on a single basis. So, maybe 5 LEDs plus/minus one.
Anyway... Color represents the "Tens" digits and "Morse Code" represents the "digit" ... programmable, but likely once a minute and then dormant again. Maybe I'm just weird, but lots of people wake at night and wonder what the time is, but when I wake at night I am more concerned with the temperature.
20120705
I still needed to write some PICAXE BASIC to ensure that the idea was reasonable and that a minimum of parts and a Nichia tri-colored LED (common anode... a single 220 Ohm resistor is used for current-limiting) could be used. The code below is my POC code and tracks a digital temperature sensor degreeF by degreeF. Internal to the code, Celsius is the root temperature, so this can easily be changed, however, I personally find Celsius temps without the decimal point a wee too broad for my tastes.
Blinking LED Color Scheme:
Case 50 to 59 ' Blue LED ; C.4
Case 60 to 69 ' Green LED ; C.2
Case 70 to 79 ' Red LED ; C.1
Please note that I have given Peter Anderson credit for the temperature routines, although I have taken some poetic license with his code... if there are errors, it is my fault and not the Prof's.
Please note that I am using Magic Morse "encoder" algorithm for generating the DIT / DAH Morse code flashes for the digit_F temperature. This algorithm is published and explained elsewhere on this Forum and in my blogs.
20260307
Arduino conversion using SpeneKonde ATTINY85 Corefile AND conversion from BASIC to Arduino using GROK
Note: NO compile errors.
Arduino 2.3.5 fully patched stats:
Sketch uses 2676 bytes (32%) of program storage space. Maximum is 8192 bytes.
Global variables use 71 bytes (13%) of dynamic memory, leaving 441 bytes for local variables. Maximum is 512 bytes.
Ray Burne