PCB_Master
12-29-2010, 03:07 PM
It's my first try with the Basic programming language, so expect the code to be sloppy. The code is a simple clock for the Genny, and it works fine, except it will not go from 59 minutes to 0, nor will it increase the hour. WHAT IS GOING ON?
Edit: For those who do not have BasiEgaXors, here is the code:
reigon=UnitType()
if reigon != 1 then goto PAL
print "Clock Demo - PCB_Master 2010"
sleep 120
cls
sleep 1
print "Please use the joypad to set the time."
sleep 60
time_H=0
time_M=00
time_TOD=0
cls
while 1
print "Please set the hour."
print ;time_H;
if joypad().0 then time_H=time_H+1
if joypad().1 then time_H=time_H-1
if joypad().6 then goto setMin
sleep 10
cls
wend
setMin
cls
sleep 30
while 1
print "Please set the minute."
print ;time_M;
if joypad().0 then time_M=time_M+1
if joypad().1 then time_M=time_M-1
if joypad().6 then goto setTOD
sleep 10
cls
wend
setTOD
cls
sleep 30
while 1
print "Please set the Time of Day."
if time_TOD == 0 then
print "AM"
else
print "PM"
endif
if joypad().0 then time_TOD=1
if joypad().1 then time_TOD=0
if joypad().6 then goto clock
sleep 10
cls
wend
clock
while 1
cls
if time_TOD == 0 then
print ;time_H; ":" ;time_M; " AM"
else
print ;time_H; ":" ;time_M; " PM"
endif
sleep 3600
time_M=time_M+1
if time_M == 60 then
time_H=time_H+1
time_M=0
endif
if time_H == 12 [and] time_M == 0 then
if time_TOD == 0 then
time_TOD=1
else
time_TOD=0
endif
endif
if time_H == 13 then time_H=1
wend
PAL
print "This software was designed to run on an US or EU Console. Sorry!"
endp
print " "
print "Program Halt."
Edit: For those who do not have BasiEgaXors, here is the code:
reigon=UnitType()
if reigon != 1 then goto PAL
print "Clock Demo - PCB_Master 2010"
sleep 120
cls
sleep 1
print "Please use the joypad to set the time."
sleep 60
time_H=0
time_M=00
time_TOD=0
cls
while 1
print "Please set the hour."
print ;time_H;
if joypad().0 then time_H=time_H+1
if joypad().1 then time_H=time_H-1
if joypad().6 then goto setMin
sleep 10
cls
wend
setMin
cls
sleep 30
while 1
print "Please set the minute."
print ;time_M;
if joypad().0 then time_M=time_M+1
if joypad().1 then time_M=time_M-1
if joypad().6 then goto setTOD
sleep 10
cls
wend
setTOD
cls
sleep 30
while 1
print "Please set the Time of Day."
if time_TOD == 0 then
print "AM"
else
print "PM"
endif
if joypad().0 then time_TOD=1
if joypad().1 then time_TOD=0
if joypad().6 then goto clock
sleep 10
cls
wend
clock
while 1
cls
if time_TOD == 0 then
print ;time_H; ":" ;time_M; " AM"
else
print ;time_H; ":" ;time_M; " PM"
endif
sleep 3600
time_M=time_M+1
if time_M == 60 then
time_H=time_H+1
time_M=0
endif
if time_H == 12 [and] time_M == 0 then
if time_TOD == 0 then
time_TOD=1
else
time_TOD=0
endif
endif
if time_H == 13 then time_H=1
wend
PAL
print "This software was designed to run on an US or EU Console. Sorry!"
endp
print " "
print "Program Halt."