View Single Post
  #5   Spotlight this post!  
Unread 04-02-2003, 07:47
rust710's Avatar
rust710 rust710 is offline
Registered User
#0862 (Lightning Robotics)
 
Join Date: Dec 2002
Location: Canton, MI
Posts: 103
rust710 is an unknown quantity at this point
Send a message via AIM to rust710
Quote:
Originally posted by Jnadke
they easy way:

Code:
drive_L              var      byte
drive_R              var      byte
tempjoystick      var      byte


drive_R = (((2000 + p1_y + p1_x - 127) Min 2000 Max 2254) - 2000)
drive_L = (((2000 + p1_y - p1_x + 127) Min 2000 Max 2254) - 2000)
'single joystick drive code


if p4_sw_aux1 = 1 then
      tempdrive = drive_R
      drive_R = 254-drive_L
      drive_L = 254-tempjoystick
endif
Your code is correct except for what is bolded. You are using two different Variables. Probably just an error when you typed it. Your code is similar to what I use on our robot.
__________________
Andrew Radamis
Programmer on 862
info@lightingrobotics.com