Code C - [expand] 1 2 3 4 5 6 7 8 for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) { P2 = (1 << i); delay(1); sendserial(~(a[i]<<i2)); // or sendserial(~(a[i]>>i2)); for the opposite direction } // you probably need some delay here }
Code C - [expand] 1 2 3 4 5 6 7 8 for (i2 = 0; i2 < 8; i2++) { for (i = 0; i < 8; i++) { P2 = (1 << i); delay(1); sendserial(~(a[i]<<i2)); // or sendserial(~(a[i]>>i2)); for the opposite direction } // you probably need some delay here }
Code C - [expand] 1 2 3 4 5 6 7 8 for (l = 0; l <29 ; l++) { for (i = 0; i < 8; i++) { P2 = (1 << i); delay(1); sendserial(~a[i+l]); delay(75); } }
void sendserial(unsigned char gireesh)
{
unsigned char gk;
P3_0 = 0;
//P3_1 = 0; [COLOR="#FF0000"]this has been moved to the main[/COLOR]
for (gk = 0x80; gk; gk >>= 1) {
if (gireesh & gk) {
P3_2 = 1; // Data 1
} else {
P3_2 = 0; // Data 0
}
P3_0 = 1;// shcp [COLOR="#FF0000"]the order of these two lines was wrong in the previous code, you need 0->1->0 for the clock[/COLOR]
P3_0 = 0; //shcp
}
//P3_1 = 1; //stcp [COLOR="#FF0000"]this has been moved to the main[/COLOR]
}
------------------------------------
[COLOR="#FF0000"]this following is from the main[/COLOR]
for (l = 0; l <21 ; l++) {
for (i = 0; i < 8; i++) {
P2 = (1 << i);
delay(1);
P3_1 = 0; //stcp [COLOR="#FF0000"]I have moved this here from sendserial[/COLOR]
sendserial(~a[i+l+8]); [COLOR="#FF0000"]send 8 bits for display2[/COLOR]
sendserial(~a[i+l]); [COLOR="#FF0000"]send 8 bits for display1[/COLOR]
P3_1 = 1; //stcp [COLOR="#FF0000"]I have moved this here from sendserial, toggles after all 16 bits have been send[/COLOR]
delay(75);
}
}
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?