??? 08/09/06 06:28 Read: times |
#121893 - debug Responding to: ???'s previous message |
hi,
Ashwin V said:
void main(void) { unsigned int j; while(1) { for(j=0x01;j<=0x80;j<<=1) { P0=j; delay(); } } }But replacing 'unsigned int' with 'unsigned char' limits the chase sequence to only once. i.e after one complete chase sequence, all pins of P0 are grounded. Did you debug your program? As Maarten Brock already said, the bug is easy find even by eight fingers. By the way: with 'unsigned char' your program goes to infinite loop with 'j' equal 0 inside for() loop so you even does not need with while(1) in this case. Look careful once again to find it yourself. Regards, Oleg |