Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
Robotc 4-wheel Joystick Test (Drive System)
SUBMITTED BY:
Guest
DATE:
Dec. 24, 2013, 11:36 p.m.
FORMAT:
Text only
SIZE:
933 Bytes
Raw
Download
Tweet
HITS:
1201
Go to comments
Report
#include "JoystickDriver.c"
task main()
{
while(true)
{
getJoystickSettings(joystick);
if(joystick.joy1_y1 < -100){
motor(motorD)= 60;
motor(motorE)= -60;
motor(motorF)= 60;
motor(motorG)= -60;
}
else
{
if(joystick.joy1_y1 > 100){
motor(motorD)= -60;
motor(motorE)= 60;
motor(motorF)= -60;
motor(motorG)= 60;
}
else{
if(joystick.joy1_x1 < -100){
motor(motorD) = 60;
motor(motorE) = 60;
motor(motorF) = 60;
motor(motorG) = 60;
}
else
{if(joystick.joy1_x1 > 100){
motor(motorD) = -60;
motor(motorE) = -60;
motor(motorF) = -60;
motor(motorG) = -60;
}
else{
motor(motorD)= 0;
motor(motorE)= 0;
motor(motorF)= 0;
motor(motorG)= 0;
}
}
}
}
}
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus