Pervasive Tangibility - 32KHz en Time of Day Clock with 60 Alarms and PWM Sequence Output <p><a href="/userfiles/image/Clock.png"><img width="300" vspace="5" hspace="5" height="502" border="5" align="left" src="/userfiles/image/Clock.png" alt="" /></a>The so-far-unnamed-project is moving forward. See <a href="sleep">here</a> and <a href="floating_pins">here</a> and <a href="fuses">here</a> for the rest of the story. The time of day clock now prints onto a serial-input Vaccum Flourescent Display. The clock has up to 60 alarms. All of the alarms fire off a function called runTask(). In the previous version of the code, each alarm task could be tied to a uinque function call. It turns out that the&nbsp; so-far-unnamed-project only needs one task. The alarm setpoints are held in a header file, also called an <em>include file</em>, which will probably be generated by a Processing app when the arduino stuff is done. The runTask() function requires an array containing about 2000 pwm values. These values live in a header file called performanceData.h. I was very surprised to learn that a user's .h files could not be included at the top of the arduino sketch. It's a long saga, but in short, it's an IDE bug. I wound up making an arduino library to get around the problem. In a library, the .h with the same name as the library, can referece other .h files included by the user. There seem to be programming issues with what you can put in the files (why?), but constant variables will work. The constant arrays are stored in program memory using the PROGMEM macro. This avoids chewing up all the RAM and crashing the AVR chip.</p> <p>CLICK READ MORE TO SEE THE REST OF THE POST</p> <p><a href="" target="_blank">read more</a></p> 32KHz arduino clock include files PROGMEM Mon, 14 Feb 2011 18:50:54 +0000 Ed_B 155 at