1 #include <REGX52.H> 2 void delay_and_check_1(void); 3 void delay_and_check(void); 4 void check_button_pres(void); 5 void display_value(void); 6 #define column 000001111; 7 unsigned char store=0x00; 8 unsigned char count=0x00; 9 void main(void){ 10 while (1){ 11 P0 = column; 12 while (P0 == column){} 13 check_button_pres(); } }
What you think, whilst interesting, doesn't really factor into how I choose to address problems here.
Assume that teachers in many places are worse than useless, and students are drilled into not questioning figures of authority. In such situations the entire class have no idea whats going on, and no one is brave enough to ask a probing question, or challenge the status quo. If the smartest kid in the room is confused, he needs the confidence to speak up for the others. If I can give one kid the confidence to raise his hand I've made a profound difference to everyone in the room.
The OP made a reasonable effort, both in presenting the source, error message and providing line number context. The deferred nature of the error could be quite perplexing.
I've run into situations like this that can keep smart people occupied for hours
while(1); { puts("Hello"); }