Help with Inputs

jledger

New Member
I built another breadboard this evening to start workinhg on the 80x quiz project, and I guess I don't understand input pins quite right. The following program works fine on everthing except input. I'm using 80X pins, 15-18. I'm attempting to tie the pin to ground to trigger switches 1,0,7,8.

Can someone take a look at this and tell me what I'm not understanding?

' Quiz Controller For 80x
' By Jeff Ledger


main:
let pins = 0

'power on indication
high 4
high 5
pause 1000
high 0
high 1
high 2
high 3
pause 2000


main2:

low 0
low 1
low 2
low 3

quizloop:

if pin1=1 then seat1
if pin0=1 then seat2
if pin7=1 then seat3
if pin6=1 then seat4
goto quizloop

seat1:
high 0
pause 5000
goto main2

seat2:
high 1
pause 5000
goto main2

seat3:
high 2
pause 5000
goto main2

seat4:
high 3
pause 5000
goto main2

goto main:



Thanks!
Jeff
 

Bloody-orc

Senior Member
as far as i understand you say that when you swich the button on the input then the input is connected to 0V and when the switch is not pressed then input is connected to +5V with 10k ohm resistor right?.

if so then all the if commands should be
if pinx = 0 then do_something

if you type if pins = 1 then the program thinks that the swich is pressed all the time (in your program atleast).

hope it helps.
 
Top