Greetings,
I am using a Peggy 2 to drive individual LEDs for a Railroad Museum display.
I have cut the number of rows driven by the board to increase brightness in the leds.
Would like to add another Peggy 2 to increase the number of points illuminated. Doing this would include the requirement that the 2 boards communicate so each Peggy board could do part of a display and hand off the other part of it to the 2nd Peggy.
The current code (1 Peggy board) looks like this;
...code snipped from source file ...
CUT.SetPoint(N34);
CUT.RefreshAllFast(dly2) ;
CUT.ClearPoint(N32) ;
CUT.RefreshAllFast(dly2) ;
CUT.ClearPoint(R6_1);
CUT.ClearPoint(R6_2);
CUT.RefreshAllFast(dly2) ;
Where the coordinates are 'defined' in an include file, and the variable(s) dly2 are initialized early in the code.
I want to increase the overall size of the program to increase running time beyond the capacity of the on-board memory.
Can an EPROM, or equivilant device, be added to hold the additional commands?
Perhaps a serial feed from another m
Comments
Perhaps a serial feed from another microcontroller with the EPROM.
Any suggestions are appreciated.
cheers
More Memory = More Run Time.
To illustrate how I am applying the Peggyboard I will give an overview in pseudo-code.
The code snippet, in the first post, is a true representation of the program structure. I am only using the following verbs; ~.SetPoint(), ~.ClearPoint(), and ~.RefreshAllFast(). Is there a better way to code this? The application is to recreate the appearance of the Railroad Track Layout Status Board for the Cincinnati Union Terminal Control Tower. Each led illuminates 1 indicator showing Track Occupancy or Signal indications. A sequence illustrates the movement of trains in the Terminal 'Yard'
A typical sequence is:
Set(N1) ;
Refresh(3 seconds) ;
Set(N2) ;
Refresh(2 Sec) ;
Clear(N1) ;
Refresh(2 Sec) ;
Set(N3) ;
ad infinitum
Is there a better way to code this?
Can there be Functions, or Macros, for repetative code sequences?
void setup()
{
CUT.HardwareInit(); // Call this to init the hardware.
CUT.Clear(); // Erase the entire frame buffer.
}
void to_Eng_Yard()
{
~Set(S5) ;
~.Refresh(3 sec) ;
~.Set(s4) ;
~.Refresh(3 sec) ;
...
}
void loop()
{
...
to_Eng_Yard() ;
{more code}
}
I have not tried it yet, nor have I found any evidence of this technique in the examples I have found.
It would be a Huge help if it works.
Thanks