int main() { set_each_analog_state(0,0,0,1,0,0,0,0); WhichSide(); SetArm(); Start(); Cubes(); }
int main() { set_each_analog_state(0,1,0,0,0,0,0,0); create_connect(); enable_servos(); armPosSB(); clawSB(); //seedReturn(); seed(); }
int main() { set_each_analog_state(0,0,0,0,0,0,0,0);// This line sets analog ports to be pullup (0) or floating (1) //variable declarations go here. // uncomment the line below to have the rest of the program wait for the starting light to turn on //wait_for_light(port_number);//replace "port_number" with the analog port number into which the light sensor is connected // uncomment the line below to have a function run for a specified amount of seconds //run_for(num_secs, function_name);//replace num_secs with the amount of time to run and function_name with your function's name }
void main() { create_connect(); enable_servos(); set_each_analog_state(1,1,0,0,0,0,0,0); initialize(); armPosBlockStack2(); clawStack2(); clawOpen(); create_drive_straight(300); run_for(3, clawGrab); create_stop(); clawGrab(); }
int main() { int port_1 = 6; int port_2 = 2; set_each_analog_state(1,1,1,1,1,1,0,0); while(!black_button()) { //cbc_display_clear(); //printf(" see_bar(%d): %d\n",14,see_bar(14)); //printf(" see_bar(%d): %d\n",15,see_bar(15)); //printf("bar sensor (%d): %d\n",port_1, bar_sensor(14, 15)); //printf("analog to inches (%d): %f\n",port_1,analog(port_1)); printf("analog to inches (%d): %f\n",port_2, analog_to_inches_avg(port_2,10)); sleep(.3); } }
int main() { set_each_analog_state(0,0,0,1,0,0,0,0);// This line sets analog ports to be pullup (0) or floating (1) create_connect(); enable_servos(); set_create_total_angle(0); set_create_distance(0); //AUO=start_process(ArmUpOpen); ArmUp(); set_servo_position( sleep(3); CenterCamera(); create_drive_straight(-200); while(digital(8) != 1) {} create_stop(); sleep(1); ArmDownClose(); sleep(3); beep(); create_drive_straight(200); sleep(2); create_stop(); }
int main() { enable_servos(); create_connect(); set_each_analog_state(1,0,0,0,0,0,0,0); /* while(up_button()==0) { while(black_button() ==0) {} clawSB(); armPosSB(); while(black_button() ==0) {} clawGrab(); clawOpen(); armPosBlockGrab(); while(black_button() ==0) {} clawClose(); while(black_button() ==0) {} armPosBlockStack1(); clawStack1(); while(black_button() ==0) {} clawOpen(); while(black_button() ==0) {} clawGrab(); armPosBlockGrab(); while(black_button() ==0) {} clawClose(); while(black_button() ==0) {} /*set_servo_position(SERVO_ARM_LEFT_PORT, SERVO_ARM_LEFT_STACK2); set_servo_position(SERVO_ARM_RIGHT_PORT, SERVO_ARM_RIGHT_STACK2); set_servo_position(SERVO_CLAW_LEFT_PORT, SERVO_CLAW_LEFT_STACK2); set_servo_position(SERVO_CLAW_RIGHT_PORT, SERVO_CLAW_RIGHT_STACK2); sleep(2); armPosBlockStack2(); clawStack2(); while(black_button() ==0) {} clawOpen(); }*/ //reach first blocks armPosBlockStack1(); clawStack1(); clawOpen(); detectBlock(); //back up backFromTouch(0); //arm to correct pos armPosBlockGrab(); clawGrab(); //scoot up and grab scootUp(0); clawClose(); while(black_button() == 0) {} driveAtMmFor(200, 2); //drive with arm a bit up, place first pair of cubes armPosBlockStack1(); clawStack1(); detectPVC(); set_servo_position(SERVO_ARM_LEFT_PORT, SERVO_ARM_LEFT_GRAB+300); set_servo_position(SERVO_ARM_RIGHT_PORT, SERVO_ARM_RIGHT_GRAB-300); set_servo_position(SERVO_CLAW_LEFT_PORT, SERVO_CLAW_LEFT_GRAB+100); set_servo_position(SERVO_CLAW_RIGHT_PORT, SERVO_CLAW_RIGHT_GRAB-100); backFromTouch(1); //correct pos armPosBlockGrab(); clawGrab(); //scoot up scootUp(1); clawOpen(); driveAtMmFor(200, 2); while(black_button() == 0) {} clawClose(); //drive with arm a bit up, place second pair on top of first armPosBlockStack1(); clawStack1(); set_servo_position(SERVO_ARM_LEFT_PORT, SERVO_ARM_LEFT_STACK1+300); set_servo_position(SERVO_ARM_RIGHT_PORT, SERVO_ARM_RIGHT_STACK1-300); set_servo_position(SERVO_CLAW_LEFT_PORT, SERVO_CLAW_LEFT_STACK1+200); set_servo_position(SERVO_CLAW_RIGHT_PORT, SERVO_CLAW_RIGHT_STACK1-200); detectBlock(); backFromTouch(2); //correct pos clawStack1(); armPosBlockStack1(); clawOpen(); driveAtMmFor(200, 2); armPosBlockGrab(); clawGrab(); while(black_button() == 0) {} clawClose(); armPosBlockStack2(); clawStack2(); detectPVC(); backFromTouch(3); clawOpen(); driveAtMmFor(200, 2); }