
Originally Posted by
RHS_electronics
thank you for all of your help, but is there a way to make it so that when you press the button it loops one program continously then, when pressed again goes to another program?
Untested but worth a try:
Code:
Button_Flag VAR BIT
DUMMY VAR BYTE
Trisa = 32
Trisc = 0
a Var porta:c var portc
x var word:t1 var word
x=0
t1=200
ANSEL = 0
ioca=%00100000
CMCON0 = 7
start:
on interrupt goto buttonpressed
INTCON = %10001000
DISABLE
buttonpressed:
IF Button_Flag = 1 THEN
gosub All_on
ELSE
gosub LEFT
endif
dummy=porta ; clear mismatch condition
INTCON.0 = 0 ; reset interrupt flag
resume
ENABLE
'...
DISABLE
all_on:
a=7:c=63
Button_Flag = 1
pause t1
return
ENABLE
DISABLE
LEFT:
A=4 : c=36:
Button_Flag = 0
pause t1
a=0: c=0
pause t1
return
ENABLE
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks