Playing with the blue led !

Hitec robotics including ROBONOVA humanoid, HSR-8498HB servos, MR C-3024 Controllers and RoboBasic
8 postsPage 1 of 1
8 postsPage 1 of 1

Playing with the blue led !

Post by Crenwick » Wed Oct 21, 2009 3:54 pm

Post by Crenwick
Wed Oct 21, 2009 3:54 pm

I tried to play with the blue led and wrote a little basic and assigned these to some of the remocon (K1,K2,K3)

led_on:
out 52,0
return

led_off:
out 52,1
return

led_toggle:
toggle 52
return

Well, it didn't work :?:
Some idee what I did wrong ?

Bernard
I tried to play with the blue led and wrote a little basic and assigned these to some of the remocon (K1,K2,K3)

led_on:
out 52,0
return

led_off:
out 52,1
return

led_toggle:
toggle 52
return

Well, it didn't work :?:
Some idee what I did wrong ?

Bernard
Crenwick offline
Robot Builder
Robot Builder
Posts: 16
Joined: Thu Oct 08, 2009 11:38 am

Post by i-Bot » Thu Oct 22, 2009 12:48 am

Post by i-Bot
Thu Oct 22, 2009 12:48 am

Did you use the template ? and modify this part:
Code: Select all
MAIN1:
A = REMOCON(1) 
A = A - ID   
ON A GOTO MAIN,K1,K2,K3,K4,K5,K6,K7,K8,K9,K10,K11,K12,K13,K14,K15,K16,K17,K18,K19,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K30,K31,K32
GOTO MAIN

with your routines ?
Did you use the template ? and modify this part:
Code: Select all
MAIN1:
A = REMOCON(1) 
A = A - ID   
ON A GOTO MAIN,K1,K2,K3,K4,K5,K6,K7,K8,K9,K10,K11,K12,K13,K14,K15,K16,K17,K18,K19,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K30,K31,K32
GOTO MAIN

with your routines ?
i-Bot offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by Crenwick » Thu Oct 22, 2009 7:43 am

Post by Crenwick
Thu Oct 22, 2009 7:43 am

Yes, I use the advanced overal template.

Code: Select all
GOTO AUTO
   FILL 255,10000
   
   DIM RR AS BYTE
   DIM A AS BYTE
   DIM A16 AS BYTE
   DIM A26 AS BYTE
   DIM I AS BYTE
   
   CONST ID = 0    ' 1:0, 2:32, 3:64, 4:96
   
   '== Action command check (50 - 82)
   IF RR > 50 AND RR < 83 THEN GOTO action_proc
   
   RR = 0
   
   PTP SETON             
   PTP ALLON            
   
   '== motor diretion setting ======================
   DIR G6A,1,0,0,1,0,0      
   DIR G6B,1,1,1,1,1,1      
   DIR G6C,0,0,0,0,0,0      
   DIR G6D,0,1,1,0,1,0      
   
   
   '== motor start position read ===================
   TEMPO 220
   MUSIC "CDEC"
   GETMOTORSET G24,1,1,1,1,1,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,1,1,0
   '== motor power on  =============================
   SPEED 5
   MOTOR G24   
   GOSUB pose_standard
   '================================================
   MAIN:
   GOSUB robot_voltage
   'GOSUB robot_tilt
   
   '-----------------------------
   IF RR = 0 THEN GOTO MAIN1
   
   ON RR GOTO MAIN,K1,K2,K3,K4,K5,K6,K7,K8,K9,K10,K11,K12,K13,K14,k15,k16,k17,k18,k19,k20,k21,k22,k23,k24,k25,k26,k27,k28,k29,k30,k31,k32
   GOTO main_exit
   '-----------------------------
   MAIN1:
   A = REMOCON(1) 
   A = A - ID   
   ON A GOTO MAIN,K1,K2,K3,K4,K5,K6,K7,K8,K9,K10,K11,K12,K13,K14,k15,k16,k17,k18,k19,k20,k21,k22,k23,k24,k25,k26,k27,k28,k29,k30,k31,k32
   GOTO MAIN
   '-------------------------------------------------
   action_proc:
   A = RR - 50
   ON A GOTO MAIN,K1,K2,K3,K4,K5,K6,K7,K8,K9,K10,K11,K12,K13,K14,k15,k16,k17,k18,k19,k20,k21,k22,k23,k24,k25,k26,k27,k28,k29,k30,k31,k32
   RETURN
   '-----------------------------
   main_exit:
   IF RR > 50 THEN RETURN
   RR = 0
    GOTO MAIN
Yes, I use the advanced overal template.

Code: Select all
GOTO AUTO
   FILL 255,10000
   
   DIM RR AS BYTE
   DIM A AS BYTE
   DIM A16 AS BYTE
   DIM A26 AS BYTE
   DIM I AS BYTE
   
   CONST ID = 0    ' 1:0, 2:32, 3:64, 4:96
   
   '== Action command check (50 - 82)
   IF RR > 50 AND RR < 83 THEN GOTO action_proc
   
   RR = 0
   
   PTP SETON             
   PTP ALLON            
   
   '== motor diretion setting ======================
   DIR G6A,1,0,0,1,0,0      
   DIR G6B,1,1,1,1,1,1      
   DIR G6C,0,0,0,0,0,0      
   DIR G6D,0,1,1,0,1,0      
   
   
   '== motor start position read ===================
   TEMPO 220
   MUSIC "CDEC"
   GETMOTORSET G24,1,1,1,1,1,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,1,1,0
   '== motor power on  =============================
   SPEED 5
   MOTOR G24   
   GOSUB pose_standard
   '================================================
   MAIN:
   GOSUB robot_voltage
   'GOSUB robot_tilt
   
   '-----------------------------
   IF RR = 0 THEN GOTO MAIN1
   
   ON RR GOTO MAIN,K1,K2,K3,K4,K5,K6,K7,K8,K9,K10,K11,K12,K13,K14,k15,k16,k17,k18,k19,k20,k21,k22,k23,k24,k25,k26,k27,k28,k29,k30,k31,k32
   GOTO main_exit
   '-----------------------------
   MAIN1:
   A = REMOCON(1) 
   A = A - ID   
   ON A GOTO MAIN,K1,K2,K3,K4,K5,K6,K7,K8,K9,K10,K11,K12,K13,K14,k15,k16,k17,k18,k19,k20,k21,k22,k23,k24,k25,k26,k27,k28,k29,k30,k31,k32
   GOTO MAIN
   '-------------------------------------------------
   action_proc:
   A = RR - 50
   ON A GOTO MAIN,K1,K2,K3,K4,K5,K6,K7,K8,K9,K10,K11,K12,K13,K14,k15,k16,k17,k18,k19,k20,k21,k22,k23,k24,k25,k26,k27,k28,k29,k30,k31,k32
   RETURN
   '-----------------------------
   main_exit:
   IF RR > 50 THEN RETURN
   RR = 0
    GOTO MAIN
Crenwick offline
Robot Builder
Robot Builder
Posts: 16
Joined: Thu Oct 08, 2009 11:38 am

Post by i-Bot » Thu Oct 22, 2009 11:34 am

Post by i-Bot
Thu Oct 22, 2009 11:34 am

You might comment out the GOSUB robot_voltage in case it over rides you control. Is you LED flashing ? Do you have resistors on voltage detect pins ?
You might comment out the GOSUB robot_voltage in case it over rides you control. Is you LED flashing ? Do you have resistors on voltage detect pins ?
i-Bot offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by Crenwick » Thu Oct 22, 2009 2:54 pm

Post by Crenwick
Thu Oct 22, 2009 2:54 pm

My gosub robot_voltage routine plays a music "cdecde". Yes I have a resistor bridge on AD6.

I tried this

Code: Select all
k5:
for i = 0 to 2
out 52,1
delay 200
out 52,0
delay 200
next i
return


and the led flashes :shock:

But with

Code: Select all
k5:
toggle 52
return


no way :?:
My gosub robot_voltage routine plays a music "cdecde". Yes I have a resistor bridge on AD6.

I tried this

Code: Select all
k5:
for i = 0 to 2
out 52,1
delay 200
out 52,0
delay 200
next i
return


and the led flashes :shock:

But with

Code: Select all
k5:
toggle 52
return


no way :?:
Crenwick offline
Robot Builder
Robot Builder
Posts: 16
Joined: Thu Oct 08, 2009 11:38 am

Post by i-Bot » Thu Oct 22, 2009 4:36 pm

Post 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 !
i-Bot offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by i-Bot » Thu Oct 22, 2009 5:06 pm

Post by i-Bot
Thu Oct 22, 2009 5:06 pm

Just checked firmware again.
Toggle works only on ports up to decimal 39. Ports are in attached:
http://robosavvy.com/Builders/i-Bot/C3024%20ports.pdf
Just checked firmware again.
Toggle works only on ports up to decimal 39. Ports are in attached:
http://robosavvy.com/Builders/i-Bot/C3024%20ports.pdf
i-Bot offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by Crenwick » Mon Oct 26, 2009 12:00 pm

Post by Crenwick
Mon Oct 26, 2009 12:00 pm

Hi i-Bot,

Thanks for the info :wink:

I will play with another led on another port.

Regards
Hi i-Bot,

Thanks for the info :wink:

I will play with another led on another port.

Regards
Crenwick offline
Robot Builder
Robot Builder
Posts: 16
Joined: Thu Oct 08, 2009 11:38 am


8 postsPage 1 of 1
8 postsPage 1 of 1