Good morning, everyone.
I explain my problem:
The short, simple program, attachment should alternatively switch the LEDs on to the four output ports using interrupt.
In PE6 it works regularly but when loading on 08m2, apart from the three lights of departure
which indicate the program start, whenever I press the c.3 button restart the program and
After a few seconds it makes the three flashes again instead of moving to the next ice.
On the above exit doors is connected an LED resistant to the negative.
The button is connected to c.3 and the resistance that keeps it low.
c.3-----button----positive
|
|
resistance
|
|
common
I changed three 08m2 with the same results.
Can someone please explain to me where the mystery of malfunction lies when
Is it installed in 08m2?
Thanks for listening.
P.S. Sorry. Google translation.
code
#picaxe 08m2
start0:
Symbol led_c.1 =c.1
Symbol led_c.2 =c.2
Symbol led_c.4 =c.4
Symbol led_c.0 =c.0
Symbol flag =b0
Symbol f_pulsante =bit0 ;Button pressure
Symbol conta =b3 ;Number of Button Pressures
Pullup %00001000
Pause 4000 ;recharge program ex new
disconnect ;makes available c.0
Pause 2000
for conta =0 to 2 ;indicates program start with three flashes
High led_c.0
pause 500
low led_c.0
pause 500
next conta
conta=0
gosub irq ;active interrupt
uno:
Do
select case conta ;exit port selection
case 0
case 1
High led_c.0
case 2
High led_c.1
case 3
High led_c.2
case 4
High led_c.4
conta=4
endselect
if f_pulsante=1 then ;when pressing the button
gosub purge
f_pulsante=0
inc conta
if conta =>5 then
conta =1
endif
endif
gosub irq ;active interrupt
Loop
goto uno
interrupt: ;bit represents port c3
f_pulsante=pinc.3 ;save pin status from call
Do
Loop While pinc.3 = 1 ;loop until the button and press
return
purge: ;empty doors
low led_c.0,led_c.1,led_c.2,led_c.4
return
IRQ:
Setint %00001000,%00001000 ; activate interrupt
Return
/code
I explain my problem:
The short, simple program, attachment should alternatively switch the LEDs on to the four output ports using interrupt.
In PE6 it works regularly but when loading on 08m2, apart from the three lights of departure
which indicate the program start, whenever I press the c.3 button restart the program and
After a few seconds it makes the three flashes again instead of moving to the next ice.
On the above exit doors is connected an LED resistant to the negative.
The button is connected to c.3 and the resistance that keeps it low.
c.3-----button----positive
|
|
resistance
|
|
common
I changed three 08m2 with the same results.
Can someone please explain to me where the mystery of malfunction lies when
Is it installed in 08m2?
Thanks for listening.
P.S. Sorry. Google translation.
code
#picaxe 08m2
start0:
Symbol led_c.1 =c.1
Symbol led_c.2 =c.2
Symbol led_c.4 =c.4
Symbol led_c.0 =c.0
Symbol flag =b0
Symbol f_pulsante =bit0 ;Button pressure
Symbol conta =b3 ;Number of Button Pressures
Pullup %00001000
Pause 4000 ;recharge program ex new
disconnect ;makes available c.0
Pause 2000
for conta =0 to 2 ;indicates program start with three flashes
High led_c.0
pause 500
low led_c.0
pause 500
next conta
conta=0
gosub irq ;active interrupt
uno:
Do
select case conta ;exit port selection
case 0
case 1
High led_c.0
case 2
High led_c.1
case 3
High led_c.2
case 4
High led_c.4
conta=4
endselect
if f_pulsante=1 then ;when pressing the button
gosub purge
f_pulsante=0
inc conta
if conta =>5 then
conta =1
endif
endif
gosub irq ;active interrupt
Loop
goto uno
interrupt: ;bit represents port c3
f_pulsante=pinc.3 ;save pin status from call
Do
Loop While pinc.3 = 1 ;loop until the button and press
return
purge: ;empty doors
low led_c.0,led_c.1,led_c.2,led_c.4
return
IRQ:
Setint %00001000,%00001000 ; activate interrupt
Return
/code