Thursday, August 3, 2023

Light Buddy 2 Scripting


Scripting is now coming in two forms.  

  1. Static LED that is time invariant
  2. Time based LED action


The time invariant scripting means that the user will setup the LED actions using this screen.  They will assign the LED effect, any features and the brightness (when available).  Using the LED option on the menu, they will store these settings in the Light Buddy 2.  When the unit powers up, it will load these settings and run forever.  This is equivalent to a one line script that is on repeat forever.

Time based is the normal scripting.  The user assigns the LED action at a given time, saves the step, increments the time base to the next event and continues.with the next LED event.

The issue with the Light Buddy 2 is the script storage.  There is no room for an external EEPROM.  The internal EEPROM storage is about 200 bytes once all the configurations data is set.  That leave about 40 script instructions.  But every LED effect takes an instruction.  If all six LEDs change at one time interval, then 6 bytes are used and that would allow for only 6 time intervals. 

There is about 4K bytes of program space left.  If I allocate 1K to script storage, that would allow for four times the storage.  Writing into program memory on a PIC is not difficult, but care must be taken as to not overwrite program storage.  This is my next task, so that I can increase the available script storage.




No comments:

Post a Comment