/* Simple example code for Peggy 2.0, using the Peggy2 and PeggyWriter libraries
*/
Peggy2 frame1; // Make a frame buffer object, called frame1
PeggyWriter myWriter1; // Make a PeggyWriter object
PeggyWriter myWriter2; // Make a PeggyWriter object
PeggyWriter myWriter3; // Make a PeggyWriter object
PeggyScroller comp1; // Make a PeggyScroller object
PeggyScroller comp2;
PeggyScroller comp3;
char scrollerSelect = 1;
char* data1 = " TEST 1 ";
char* data2 = " TEST 2 ";
char* data3 = " TEST 3 ";
int j = 0;
char mF1;
char mF2;
char mF3;
int k = 0;
int l = 0;
String s1, s2, s3;
void setup()
{
frame1.HardwareInit();
comp2.init(&frame1, &myWriter1, 7, data2);
comp3.init(&frame1, &myWriter2, 14, data3);
comp1.init(&frame1, &myWriter3, 1, data1);
}
void loop()
{
long delayCount = 0;
mF1 = comp1.scrollLeft();
mF2 = comp2.scrollLeft();
mF3 = comp3.scrollLeft();
// Refresh Peggy lots of times while we kill time.
// switch messages if one has completed.
if (mF1 == 0){
data1 = " COMP 1 ? ";
comp1.init(&frame1, &myWriter1, 1, data1);
}
if (mF2 == 0){
data2 = " COMP 2 ? ";
comp2.init(&frame1, &myWriter2, 7, data2);
}
if (mF3 == 0){
data3 = " COMP 3 ? ";
comp3.init(&frame1, &myWriter3, 14, data3);
}
while (delayCount < 150)
{
frame1.RefreshAll(1);
delayMicroseconds(50);
delayCount++;
}
delayCount = 0;
}
Comments