Shop OBEX P1 Docs P2 Docs Learn Events
Hitec 6channel mixing question? — Parallax Forums

Hitec 6channel mixing question?

wmngummiewmngummie Posts: 2
edited 2009-04-20 09:51 in Robotics
I am planning on making a robot using the motor mount and wheel kit with position controller and hb-25 motor controller and want to use a hitec transmitter and want to know how to mix the signal?· I want to use the right stick to control the direction, up goes forward, to the left, turns left ect.· I can get it to go forward and reverse but any information on how to mix the signal with the 2nd channel to make it turn would be helpful.· thanks

Comments

  • Tom CTom C Posts: 461
    edited 2009-04-03 11:28
    wmngummie,

    Try this.

    Regards,

    TCIII

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If you are going to send·a Robot·to save the world, you·better make sure it likes it the way it is!
  • roadrunner3groadrunner3g Posts: 36
    edited 2009-04-20 09:51
    here's a simple program that will give you two RC modes to try. I wrote this one to calibrate a sabertooth 2x10rc with my current project.


    '{$STAMP BS2}
    '{$PBASIC 2.5}

    FWD_ESC PIN 15
    Turn_ESC PIN 14
    whl VAR Word
    thr VAR Word
    selector VAR Word
    FREQOUT 4,1000,4500

    '
    'GOTO U_turn

    mode:
    RC:
    PULSIN 10,1,selector
    IF selector >750 THEN rc2
    PULSIN 12,1,whl
    PULSIN 11,1,thr
    DEBUG DEC whl, " whl ", DEC thr, " thr ",CR
    PULSOUT 15,whl
    PULSOUT 14,thr
    PAUSE 20
    GOTO RC

    rc2:
    PULSIN 12,1, thr
    PULSIN 11,1, whl
    DEBUG DEC whl," & ",DEC thr,CR
    IF whl >= 900 AND thr >= 900 THEN lt
    IF whl >= 900 AND thr >= 700 THEN tl
    IF whl >= 900 AND thr >= 500 THEN rtr
    IF whl >= 700 AND thr >= 900 THEN forr
    IF whl >= 700 AND thr >= 700 THEN stopp
    IF whl >= 700 AND thr >= 500 THEN revv
    IF whl >= 500 AND thr >= 900 THEN rt
    IF whl >= 500 AND thr >= 700 THEN tr
    IF whl >= 500 AND thr >= 500 THEN ltr

    forr:
    DEBUG " forward "
    PULSOUT FWD_ESC,1000
    PULSOUT Turn_ESC,750
    PAUSE 5
    GOTO mode

    revv:
    DEBUG " reverse "
    PULSOUT FWD_ESC,500
    PULSOUT Turn_ESC,750
    PAUSE 5
    'RETURN
    GOTO mode

    tr:
    DEBUG " turn_right "
    PULSOUT FWD_ESC,750
    PULSOUT Turn_ESC,500
    PAUSE 5
    GOTO mode

    rt:
    DEBUG " right_tick "
    PULSOUT FWD_ESC,1000
    PULSOUT Turn_ESC,500
    PAUSE 5
    GOTO mode

    lt:
    DEBUG " left_tick "
    PULSOUT FWD_ESC,1000
    PULSOUT Turn_ESC,1000
    PAUSE 5
    GOTO mode

    tl:
    DEBUG " turn_left "
    PULSOUT FWD_ESC,750
    PULSOUT Turn_ESC,1000
    PAUSE 5
    GOTO mode

    rtr:
    DEBUG " rtr "
    PULSOUT FWD_ESC,500
    PULSOUT Turn_ESC,1000
    PAUSE 5
    GOTO mode

    ltr:
    DEBUG " ltr "
    PULSOUT FWD_ESC,500
    PULSOUT Turn_ESC,500
    PAUSE 5
    GOTO mode



    spin:
    DEBUG " spin "
    PULSOUT FWD_ESC,750
    PULSOUT Turn_ESC,1000
    PAUSE 500
    RETURN
    GOTO mode

    slow:
    DEBUG " slow "
    PULSOUT FWD_ESC,890
    PULSOUT Turn_ESC,750
    PAUSE 5
    GOTO mode

    slow_R:
    DEBUG " slow_R "
    PULSOUT FWD_ESC,600
    PULSOUT Turn_ESC,750
    PAUSE 5
    GOTO mode

    aux1:
    aux2:
    aux3:
    aux4:
    aux5:

    U_turn:
    DEBUG " U_turn "
    GOSUB revv
    PAUSE 2000
    GOSUB spin
    PAUSE 2000
    GOTO stopp
    GOTO mode
    aux6:

    aux7:
    'FREQOUT 4, 500,5432
    GOTO mode

    stopp:
    'DEBUG " stop "
    PULSOUT FWD_ESC,750
    PULSOUT Turn_ESC,750
    PAUSE 5
    'RETURN
    GOTO mode
Sign In or Register to comment.