View Single Post
  #1   Spotlight this post!  
Unread 09-11-2011, 16:55
stuart1086 stuart1086 is offline
Registered User
FTC #1086
 
Join Date: Nov 2011
Location: Richmond, VA
Posts: 3
stuart1086 is an unknown quantity at this point
ROBOTC servo code fails after update

So, we had some code that displayed servos and their capabilities. After reimaging the computer and reinstalling a new version of ROBOTC, our program wouldn't work. We tried everything, programming, electrical, or otherwise. This is the elementary program we created to test if servos would move at all:
Code:
#pragma config(Hubs,  S1, HTServo,  none,     none,     none)
#pragma config(Servo,  srvo_S1_C1_1,    motor1,               tServoNormal)
#pragma config(Servo,  srvo_S1_C1_2,    motor2,               tServoNormal)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main(){
  while(true){
    //Bend it one way, wait, bend the other way  	
    servoTarget[srvo_S1_C1_1] = 120;
    servoTarget[srvo_S1_C1_2] = 120;
    wait1Msec(1000);
    servoTarget[srvo_S1_C1_1]= 0;
    servoTarget[srvo_S1_C1_2]= 0;
    wait1Msec(1000);
  }
}
Is something wrong with this? Or is it ROBOTC? We have ROBOTC version 1.40.