Hi guys back again to pick your brains.
Basically Im want my 18X to activate a seperate alarm (9v) which is switched on via push button connecting the alarm terminals across pin X and 0V. obviosuly im not going to put the terminals straight into the pic, so can it be done by simply putting a resistor in line or will i need some sort of relay?
Second is using a 14m Im trying to make a simple key code using 5 buttons where one code is inputted and then it produces pin 0 hight and then if another is pressed pin 2 will go high. Not sure where I have done wrong but every time Pin 4 is pressed pin 0 just goes high no matter what order the are pressed and pin 2 never goes high!
main:
label_1: if pin1=1 then label_2
pause 1000
goto label_1
label_2: pause 1000
if pin2=1 then label_3
goto label_1
label_3: pause 1000
if pin3=1 then label_4
goto label_1
label_4: pause 1000
if pin4=1 then label_5
goto label_1
label_5: pause 1000
if pin0=1 then label_6
high 0
pause 1000
low 0
goto label_1
label_6: high 2
pause 1000
low 2
pause 1000
goto label_1
I know this is fairly straight forward stuff for you guys but I'm still learning
Thanksssssssssssssssssssss
Basically Im want my 18X to activate a seperate alarm (9v) which is switched on via push button connecting the alarm terminals across pin X and 0V. obviosuly im not going to put the terminals straight into the pic, so can it be done by simply putting a resistor in line or will i need some sort of relay?
Second is using a 14m Im trying to make a simple key code using 5 buttons where one code is inputted and then it produces pin 0 hight and then if another is pressed pin 2 will go high. Not sure where I have done wrong but every time Pin 4 is pressed pin 0 just goes high no matter what order the are pressed and pin 2 never goes high!
main:
label_1: if pin1=1 then label_2
pause 1000
goto label_1
label_2: pause 1000
if pin2=1 then label_3
goto label_1
label_3: pause 1000
if pin3=1 then label_4
goto label_1
label_4: pause 1000
if pin4=1 then label_5
goto label_1
label_5: pause 1000
if pin0=1 then label_6
high 0
pause 1000
low 0
goto label_1
label_6: high 2
pause 1000
low 2
pause 1000
goto label_1
I know this is fairly straight forward stuff for you guys but I'm still learning
Thanksssssssssssssssssssss