miaminanax.blogg.se

How To Code In Robotc
how to code in robotc

























how to code in robotc

Code In Robotc Code Work With

Didn't rename the Sonar sensor// set a forward function, will use it with waitInMilliseconds command later// set a turnright function, will use it with waitInMilliseconds command later// move the robot out of the start area , go straight and turn right// after robot out of start area, keep moving forward until meet the dark line//use lineTrackForTime command to make the robot follow the line//after the line ends, robot will keep move forward until the sonar sensor detect the distance to the wall(less than 30cm), then it stopsHow can I make the code work with the claw bot to do the line following?TLDR: Dont shouldnt use PLTW with the claw robotThe PLTW for vex has hardcoded motor ports. #pragma config(StandardModel, "RVW SQUAREBOT")#pragma config(RenamedStdModelSensor, in1, leftline)#pragma config(RenamedStdModelSensor, in2, centerline)#pragma config(RenamedStdModelSensor, in3, rightline)//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//// already set the line follower sensors and sonar sensor. The config() pragma tells RobotC to automatically include the necessary prefix code to configure your program to use the motor and sensor ports youRobot C Tutorial Videos Click the cortex to watch the Setting video for RobotC How to run a motor for 3 seconds in Robot C How to code for a button / switch.The following code works on the square bot but not on the claw bot.

...how to code in robotc

This language allows for more flexibility, and if done correctly can be used with both robots(while the PLTW is limited to the square robot). It may not have the lineTrackForTime function exactly, but it offers lineTrackLeft & lineTrackRight which you can utilize as such(taken from documentation if you need the time ability).

how to code in robotc