View unanswered posts | View active topics It is currently Fri Sep 25, 2020 12:33 pm

Reply to topic  [ 2 posts ] 
robotc main program help 
Author Message

Joined: Sat Jun 27, 2009 4:52 pm
Posts: 7
Post robotc main program help
My program will only allow me to use the joysticks to control the drive motors. The code seems to read just the joysticks in this program. The buttons seem to not work. Is this an error in my code, or a glitch in the program?

This is the troublesome program:

#pragma config(Hubs, S1, HTMotor, HTMotor, HTServo, none)
#pragma config(Sensor, S2, downy, sensorTouch)
#pragma config(Sensor, S3, uppy, sensorTouch)
#pragma config(Sensor, S4, batman, sensorSONAR)
#pragma config(Motor, motorA, spinny, tmotorNormal, openLoop)
#pragma config(Motor, motorB, belty, tmotorNormal, openLoop, reversed)
#pragma config(Motor, motorC, spinnie, tmotorNormal, openLoop)
#pragma config(Motor, mtr_S1_C1_1, rrr, tmotorNormal, openLoop, reversed, encoder)
#pragma config(Motor, mtr_S1_C1_2, lll, tmotorNormal, openLoop, encoder)
#pragma config(Motor, mtr_S1_C2_1, liftarm, tmotorNormal, openLoop, reversed, encoder)
#pragma config(Motor, mtr_S1_C2_2, motorG, tmotorNormal, openLoop)
#pragma config(Servo, srvo_S1_C3_1, , tServoNormal)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//

#include "JoystickDriver.c"

task main()
int threshold = 20;
//servoChangeRate[servoright] = 2;
//servoChangeRate[servoleft] = 2;

if(abs(joystick.joy1_y2) > threshold)
motor[rrr] = (joystick.joy1_y2);
motor[rrr] = 0;
if(abs(joystick.joy1_y1) > threshold)
motor[lll] = (joystick.joy1_y1);
motor[lll] = 0;


Thank you.

Wed Feb 03, 2010 3:52 pm

Joined: Mon Oct 27, 2008 9:59 pm
Posts: 139
Post Re: robotc main program help
I'm not sure I understand your question...
What specifically are you trying to do with the buttons? Your code example does not use any buttons.

Thu Feb 04, 2010 10:35 am
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.