hi!
I'm writing data to a flipdot board of size 7x28. This is done by sending a 3-byte length prefix, a 28-byte data and 1-byte suffix.
I get the board to display the first two lines of text. But I would like the text to rotate over the board and come back at the position it started in.
Does anybody know what is missing in my code? At this moment the r[0]=studio[i+j]; is not doing anything.
when I use r[0]=random(128) it displays 28 times a scattered field over the display.
Thanks already!
code:
// control pin
int txden = 8;
// data prefix
byte data_prefix[] = {0x80, 0x83, 0x15};
// data suffix
byte data_suffix[] = {0x8F};
// studio
byte studio[] = {B0000000, B0000000, B0000000, B0101100, B0101010, B0011010, B0000000, B0000010, B0111110, B0000010, B0000000, B0111110, B0100000, B0111110, B0000000, B0111110, B0100010, B0011100, B0000000, B0111110, B0000000, B0111110, B0100010, B0111110, B0000000, B0000000, B0000000, B0000000};
// designs
byte designs[] = {B0000000, B0111110, B0100010, B0011100, B0000000, B0111110, B0101010, B0101010, B0000000, B0101100, B0101010, B0011010, B0000000, B0111110, B0000000, B0111110, B0100010, B0111010, B0000000, B0111110, B0000010, B0111110, B0000000, B0101100, B0101010, B0011010, B0000000, B0000000};
void setup() {
// put your setup code here, to run once:
Serial.begin(57600);
pinMode(txden, OUTPUT);
digitalWrite(txden, HIGH); // master
Serial.write(data_prefix, 3);
Serial.write(designs, 28);
Serial.write(data_suffix, 1);
delay(1000);
Serial.write(data_prefix, 3);
Serial.write(studio, 28);
Serial.write(data_suffix, 1);
delay(1000);
int i,j;
byte r[]={0};
for (j=0;j<=28;j++){
Serial.write(data_prefix,3);
for (i=0;i<28;i++){
r[0]=studio[i+j];
//r[0]=random(128);
Serial.write(r, 1);
}
Serial.write(data_suffix,1);
delay(250);
}
}
void loop() {
// put your main code here, to run repeatedly:
}
