Posted: Mon Aug 06, 2012 7:40 pm Post subject: Problems with input (noob question)
Hello, I have a question.
I have a atmel mega 32A proc. I did write some little programs for leds. They all work.
Can somebody help me to write an instruction to read the switches?
I have mounted 3 switches to my testing board and wired them to ground and to the proc. on port B 0,1,2.
In the simulation program of bascom it works but not on my hardware.
But i cant to get the B ports to switch to pull down mode.
config pinb.0 = input ' use in input mode and connect pin to a switch, and other side of switch to ground
portb.0=1 ' activate pull up so you read '1' by default
do
if pinb.0=0 then '
nop ' switch pressed
end if
loop _________________ Mark
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum