View Single Post
  #5   Spotlight this post!  
Unread 29-01-2003, 18:02
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
Quote:
Originally posted by mjt902
Yes, you can use the p1_y or p2_y but it CHANGES TO WHATEVER THE REAL VALUE IS FROM THE JOYSTICK. When your program runs, it sees your joystick at roughly 127, and then your code changing it to 150. This makes is continually switch from 127 to 150 to 127.

you could set your wheel to make p1_y = 150 but it's safer, and (although this is coming from someone completely insane and mentally unstable) easier to use your drive variable.
Not true. p1_y is not "bound" to the joystick. It only gets updated when you do a SERIN. Otherwise, it acts like any other normal variable. Likewise, setting PWM1 to a value won't actually change the value sent to the motor until you do a SEROUT.
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php