When I download my program to a 40x1 without a debug command, it does not work. If I out a debug command in it anywhere, it works perfectly.
Can anyone explain this.
Also, when working with the programming editor, after 2-3 downloads it stops connecting to the picaxe. I have to restart the programming editor to download again. Anyone see this before?
Heres the code
init:
serout 7,N2400,(254,1) 'Initialize and clear LCD
pause 500
high 6 'Inital LED-DISARMED
let b1=0
let b3=0 'Initial status-DISARMED
scan: 'Scans keypad for btn pushes
let b2=0
low 3 'Scan btn 1,2,3
high 0
gosub keytest
let b2=3
low 0 'Scan btn 4,5,6
high 1
gosub keytest
let b2=6
low 1 'Scan btn 7,8,9
high 2
gosub keytest
let b2=9
low 2 'Scan btn *,0,#
high 3
gosub keytest
goto scan
keytest: 'column test
if pin0=1 then add3
if pin1=1 then add2
if pin2=1 then add1
return
add1:let b2=b2+1 'Add three to row base
add2:let b2=b2+1 'Add two to row base
add3:let b2=b2+1 'Add one to row base
serout 7,N2400,(254,192,#b2)
let b1=b1+1 'PIN order logic
if b1>4 then res
branch b1,(test1,test2,test3,test4)
test1: 'PIN first num validation
if b2=7 then continue
goto res
test2: 'PIN second num validation
if b2=8 then continue
goto res
test3: 'PIN third num validation
if b2=9 then continue
goto res
test4: 'PIN fourth num validation
if b2=7 then validate
goto res
validate: 'Validation simply for visual effect
serout 7,N2400,(254,1)
serout 7,N2400,(254,128,"Validating"
serout 7,N2400,(254,138,".."
pause 500
serout 7,N2400,(254,140,".."
pause 500
serout 7,N2400,(254,142,".."
pause 300
status: 'Test armed/disarmed state
if b3=1 then disarm
if b3=0 then arm
arm: 'ARM command
low 6 'Switch off unarmed LED
high 3 'Send arm command to MASTER
serout 7,N2400,(254,128," System ARMED "
high 5 'Switch on armed LED
let b3=1 'Set keypad state to armed
goto res
disarm: 'DISARM command
low 5 'Switch off armed LED
low 3 'Send disarm command to MASTER
serout 7,N2400,(254,128,"System DISARMED"
high 6 'Switch on unarmed LED
let b3=0 'Set keypad state to disarmed
res: 'Resets PIN order logic
let b1=0
continue: 'Returns to scan cycle
return
Edited by - Jon Henry on 01/08/2007 16:25:42
Can anyone explain this.
Also, when working with the programming editor, after 2-3 downloads it stops connecting to the picaxe. I have to restart the programming editor to download again. Anyone see this before?
Heres the code
init:
serout 7,N2400,(254,1) 'Initialize and clear LCD
pause 500
high 6 'Inital LED-DISARMED
let b1=0
let b3=0 'Initial status-DISARMED
scan: 'Scans keypad for btn pushes
let b2=0
low 3 'Scan btn 1,2,3
high 0
gosub keytest
let b2=3
low 0 'Scan btn 4,5,6
high 1
gosub keytest
let b2=6
low 1 'Scan btn 7,8,9
high 2
gosub keytest
let b2=9
low 2 'Scan btn *,0,#
high 3
gosub keytest
goto scan
keytest: 'column test
if pin0=1 then add3
if pin1=1 then add2
if pin2=1 then add1
return
add1:let b2=b2+1 'Add three to row base
add2:let b2=b2+1 'Add two to row base
add3:let b2=b2+1 'Add one to row base
serout 7,N2400,(254,192,#b2)
let b1=b1+1 'PIN order logic
if b1>4 then res
branch b1,(test1,test2,test3,test4)
test1: 'PIN first num validation
if b2=7 then continue
goto res
test2: 'PIN second num validation
if b2=8 then continue
goto res
test3: 'PIN third num validation
if b2=9 then continue
goto res
test4: 'PIN fourth num validation
if b2=7 then validate
goto res
validate: 'Validation simply for visual effect
serout 7,N2400,(254,1)
serout 7,N2400,(254,128,"Validating"
serout 7,N2400,(254,138,".."
pause 500
serout 7,N2400,(254,140,".."
pause 500
serout 7,N2400,(254,142,".."
pause 300
status: 'Test armed/disarmed state
if b3=1 then disarm
if b3=0 then arm
arm: 'ARM command
low 6 'Switch off unarmed LED
high 3 'Send arm command to MASTER
serout 7,N2400,(254,128," System ARMED "
high 5 'Switch on armed LED
let b3=1 'Set keypad state to armed
goto res
disarm: 'DISARM command
low 5 'Switch off armed LED
low 3 'Send disarm command to MASTER
serout 7,N2400,(254,128,"System DISARMED"
high 6 'Switch on unarmed LED
let b3=0 'Set keypad state to disarmed
res: 'Resets PIN order logic
let b1=0
continue: 'Returns to scan cycle
return
Edited by - Jon Henry on 01/08/2007 16:25:42