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(); } }
I really think that some questions should not be given such direct answers. Since the op can't even be bothered to give the question, i really believe it doesnt deserve the aprecise answers supplied.
Give a man a fish and feed him for a day. Don't teach a man to fish...and feed yourself. He's a grown man and fishing is not that hard.
Give a man a fish and feed him for a day. Don't teach a man to fish...and feed yourself I think in this case: "give a man a log and he is warm for a day, set him on fire and he is warm for the rest of his life" is a better saying
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"); }