|
dirk_999
10 posts
 Popping In
|
09-04-2012 15:06
I plug the switch bord on portB.
I plug the led bord on portC.
I press switch B0 and I'm holding it down the entire time.
I download the following program in the µC.
trisb=0b11111111;
trisc=0b00000000;
portc=0b00000000;
delay_s(2);
while(portb&0b00000001); //waiting loop
portc=0b00000001;
while(1);
After 2 seconds the led C0 goes on. What is the reason for this?
I hoped that the led C0 would light up but only when I let the button B0 go.
Thanks in advance for your help
|
|

GeenBert
81 posts
 Frequent Visitor
|
10-04-2012 09:26
Did you connect the switchboard to the power?
|
|
dirk_999
10 posts
 Popping In
|
10-04-2012 15:35
thanks that was my stupid fault
|
|

GeenBert
81 posts
 Frequent Visitor
|
10-04-2012 16:41
Glad to hear that this solved your problem. Enjoy the course.
|