I'm trying to program AVR STK500 with Codevision (c++) & run it with AVRstudio4.
I want to make this : When PIND.0 is set then the outpout PORTB.1 & PORTB.4 are "1" and a message in lcd,when it is "0" nothing happens.
i write the code and it works. (PIND.0 is connnected with a switch).
if i connect a second switch to input PIND.1 and program it when it is set "1"
to do something and when it is "0" something else then nothing works right
and the 2 occasions are on always or works the one input or the other.
i've attached t he code below.
There is another way that i wouldn't use the "if" command because i think this makes the problems
I want to make this : When PIND.0 is set then the outpout PORTB.1 & PORTB.4 are "1" and a message in lcd,when it is "0" nothing happens.
i write the code and it works. (PIND.0 is connnected with a switch).
if i connect a second switch to input PIND.1 and program it when it is set "1"
to do something and when it is "0" something else then nothing works right
and the 2 occasions are on always or works the one input or the other.
i've attached t he code below.
There is another way that i wouldn't use the "if" command because i think this makes the problems
Attachments
-
4 KB Views: 36