Thread: PBASIC problem
View Single Post
  #8   Spotlight this post!  
Unread 16-02-2002, 23:13
GhettoTech GhettoTech is offline
Registered User
#0300 (Ghetto Techs)
 
Join Date: Feb 2002
Location: Philadelphia
Posts: 21
GhettoTech is an unknown quantity at this point
Send a message via AIM to GhettoTech
There are definantly several different ways to solve this problem.

Mechanically:
You could run a chain from one motor to drive two wheels on one side.

Electronically:
You could use the Y splitters from one PWM output to go to two different speed controllers (each controlling a different motor)

Softwar(ly?):
The "Serout" command at the end of the default code is what sends out the signals to all the electronics. You could simply connect each motor's speed controller to its own PWM output. (Let's suppose the motors on PWM 1 and PWM 2 are the two motors you want to run simultaneously from one joystick [plugged into port1], and PWM 3 & 4 from the other joystick [plugged into port 2])
You could change the output line from:
Serout USERCPU, OUTBAUD, [255,255,p1_y,relayA,p2_y,relayB,p3_y,p4_y,... (etc)
to:
Serout USERCPU, OUTBAUD, [255,255,p1_y,relayA,p1_y,relayB,p2_y,p2_y,...(etc)

Or

you could leave the output line alone and simply add, right before the Serout command:
p4_y = p2_y 'This makes PWM 4's output be controlled by Port 2's joystick (y-axis)
p3_y = p2_y 'This makes PWM 3's output be controlled by Port 2's joystick
p2_y = p1_y 'This makes PWM 2's output be controlled by Port 1's joystick

' Default program's comment code....
' blah blah blah

Serout USERCPU, OUTBAUD, [255,255,p1_y,relayA,p2_y,relayB,p3_y,p4_y,...(etc)



Whatever method is best for you, go for it