by i-Bot » Thu Oct 22, 2009 4:36 pm
by i-Bot
Thu Oct 22, 2009 4:36 pm
Yes, you are right Toggle does not work on port 52.
I tried this code:
- Code: Select all
'================================================
' Simple Template
'
' RR : internal parameter variable / ROBOREMOCON / Action command
DIM RR AS BYTE
DIM A AS BYTE
DIM i AS INTEGER
'================================================
MAIN:
A = REMOCON(1)
ON A GOTO MAIN,K1,K2,K3,K4
GOTO MAIN
'-------------------------------------------------
'================================================
k1:
GOSUB led_on
GOTO MAIN
k2:
GOSUB led_off
GOTO MAIN
k3:
GOSUB led_toggle
GOTO MAIN
k4:
GOSUB led_Flash
GOTO MAIN
led_on:
OUT 52,0
RETURN
led_off:
OUT 52,1
RETURN
led_toggle:
TOGGLE 29
RETURN
led_flash:
FOR i = 0 TO 2
OUT 52,1
DELAY 200
OUT 52,0
DELAY 200
NEXT i
RETURN
I compiled OK to this byte code:
- Code: Select all
0x40 byte RR
0x41 byte A
0x42 int I
0x10 @0x41 = REMOCON 1
0x16 ON @0x41 [0x10] [0x27] [0x2D] [0x33] [0x39]
0x24 GOTO [ 0x10]
0x27 GOSUB [ 0x3F]
0x2A GOTO [ 0x10]
0x2D GOSUB [ 0x44]
0x30 GOTO [ 0x10]
0x33 GOSUB [ 0x49]
0x36 GOTO [ 0x10]
0x39 GOSUB [ 0x4D]
0x3C GOTO [ 0x10]
0x3F OUT 52, 0
0x43 RET
0x44 OUT 52, 1
0x48 RET
0x49 TOGGLE 52
0x4C RET
0x4D FOR @0x42 = 0
0x51 TO @0x42 = 2, [0x6D]
0x58 OUT 52, 1
0x5C DELAY 200
0x5F WAIT
0x60 OUT 52, 0
0x64 DELAY 200
0x67 WAIT
0x68 NEXT @0x42, [0x51]
0x6D RET
0x6E GOTO [ 0x6E]
and ran OK except for the toggle.
I looked in the C3024 firmware and toggle on port 52 is not supported in the firmware !
Yes, you are right Toggle does not work on port 52.
I tried this code:
- Code: Select all
'================================================
' Simple Template
'
' RR : internal parameter variable / ROBOREMOCON / Action command
DIM RR AS BYTE
DIM A AS BYTE
DIM i AS INTEGER
'================================================
MAIN:
A = REMOCON(1)
ON A GOTO MAIN,K1,K2,K3,K4
GOTO MAIN
'-------------------------------------------------
'================================================
k1:
GOSUB led_on
GOTO MAIN
k2:
GOSUB led_off
GOTO MAIN
k3:
GOSUB led_toggle
GOTO MAIN
k4:
GOSUB led_Flash
GOTO MAIN
led_on:
OUT 52,0
RETURN
led_off:
OUT 52,1
RETURN
led_toggle:
TOGGLE 29
RETURN
led_flash:
FOR i = 0 TO 2
OUT 52,1
DELAY 200
OUT 52,0
DELAY 200
NEXT i
RETURN
I compiled OK to this byte code:
- Code: Select all
0x40 byte RR
0x41 byte A
0x42 int I
0x10 @0x41 = REMOCON 1
0x16 ON @0x41 [0x10] [0x27] [0x2D] [0x33] [0x39]
0x24 GOTO [ 0x10]
0x27 GOSUB [ 0x3F]
0x2A GOTO [ 0x10]
0x2D GOSUB [ 0x44]
0x30 GOTO [ 0x10]
0x33 GOSUB [ 0x49]
0x36 GOTO [ 0x10]
0x39 GOSUB [ 0x4D]
0x3C GOTO [ 0x10]
0x3F OUT 52, 0
0x43 RET
0x44 OUT 52, 1
0x48 RET
0x49 TOGGLE 52
0x4C RET
0x4D FOR @0x42 = 0
0x51 TO @0x42 = 2, [0x6D]
0x58 OUT 52, 1
0x5C DELAY 200
0x5F WAIT
0x60 OUT 52, 0
0x64 DELAY 200
0x67 WAIT
0x68 NEXT @0x42, [0x51]
0x6D RET
0x6E GOTO [ 0x6E]
and ran OK except for the toggle.
I looked in the C3024 firmware and toggle on port 52 is not supported in the firmware !