|
Page 1 of 1
|
[ 3 posts ] |
|
| Author |
Message |
|
mijial13
Rookie
Joined: Tue Dec 23, 2008 2:42 pm Posts: 12
|
 Servo doesnt move
When i download the duel joysticks with servo and i use the debugger the nxt gives an error code PgmCnt 000063 Type 34 this is my program
#pragma config(Hubs, S1, HTMotor, HTMotor, HTServo, none) #pragma config(Motor, mtr_S1_C1_1, motorD, tmotorNormal, openLoop) #pragma config(Motor, mtr_S1_C1_2, motorE, tmotorNormal, openLoop) #pragma config(Servo, srvo_S1_C3_1, servoA, tServoNormal) //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
#include "JoystickDriver.c" //Include file to "handle" the BT messages.
task main() { while (true) //Loop forever { getJoystickSettings(joystick); //Update variables with current joystick values motor[motorE] = joystick.joy1_y2; //Assign motorE (Motor 2) to the Right Y-Axis
servoTarget[servo1] = joystick.joy2_x1 + 127; //We're setting the servo's position here to the joystick's Left X-axis //But since Servos range from 0-255 and Joysticks range from -127 to 127 //We'll add the lower limit of the joystick (127) to make the ranges match.
if(joy1Btn(1)) //If Joystick Button #1 is pressed { motor[motorA] = 100; //Turn NXT MotorA on at 50% power } else //If Joystick Button #1 is not pressed { motor[motorA] = 0; //Turn NXT MotorA on at 0% power (off) } } }
Thanks
|
| Tue Dec 23, 2008 2:55 pm |
|
 |
|
10nisman94
Novice
Joined: Mon Oct 13, 2008 6:29 pm Posts: 75 Location: Florida, USA
|
 Re: Servo doesnt move
Try redownloading your firmware, we had a similar problem
_________________ PHUHS Robotics Team 516 FTW
Daytona Robofest Winning Alliance Captain Daytona Robofest Inspire Award
|
| Wed Dec 24, 2008 9:00 am |
|
 |
|
arkarind
Rookie
Joined: Mon Nov 03, 2008 1:11 am Posts: 5
|
 Re: Servo doesnt move
I think I know the problem.. i dunno if this is right.. but.. I saw in your configuration you named the servo as ServoA, but when you are using the servo in your program, you reffered to the servo as servo1. try changing this to servoA
like below: #pragma config(Hubs, S1, HTMotor, HTMotor, HTServo, none) #pragma config(Motor, mtr_S1_C1_1, motorD, tmotorNormal, openLoop) #pragma config(Motor, mtr_S1_C1_2, motorE, tmotorNormal, openLoop) #pragma config(Servo, srvo_S1_C3_1, servoA, tServoNormal) //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
#include "JoystickDriver.c" //Include file to "handle" the BT messages.
task main() { while (true) //Loop forever { getJoystickSettings(joystick); //Update variables with current joystick values motor[motorE] = joystick.joy1_y2; //Assign motorE (Motor 2) to the Right Y-Axis
servoTarget[servoA] = joystick.joy2_x1 + 127; //We're setting the servo's position here to the joystick's Left X-axis //But since Servos range from 0-255 and Joysticks range from -127 to 127 //We'll add the lower limit of the joystick (127) to make the ranges match.
if(joy1Btn(1)) //If Joystick Button #1 is pressed { motor[motorA] = 100; //Turn NXT MotorA on at 50% power } else //If Joystick Button #1 is not pressed { motor[motorA] = 0; //Turn NXT MotorA on at 0% power (off) } } }
i dunno thats just a guess of mine.. but try it and let us know if that works or not
_________________ I am a Member of FTC team Flaming Cup noodles, team # 2869.
|
| Sat Dec 27, 2008 4:29 pm |
|
|
|
Page 1 of 1
|
[ 3 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
|
|