_________________Sorry, your program could not be downloaded. Please reboot your computer.FTC Team #2959 Team Smash Bros CLICK HERE.(or click www)

Quote:

What the world needs is more geniuses with humility, there are so few of us left.

Agreed

Sun Sep 21, 2008 8:16 pm

Dick Swan

Creator

Joined: Fri Feb 09, 2007 9:21 amPosts: 616

Re: RobotC commands/syntax

guopeter wrote:

Does anyone know the programming format for the commands:-SetSensorType;-SetSensorMode-SensorQuadEncoder;-SensorType-SensorFullCountetc.???

If you use the "Motors and Sensors Setup" command on the "Robot" sub-menu it will automatically generate the appropriate code to setup sensors for you. What it generates are a bunch of "#pragma" statements as the first line of your program. Then the compiler recognizes these pragmas -- which define the characteristics of the motors and sensors and automatically generates the code for them as part of the "prolog" code that is run at the start of your program.

"SetSensorType" sets up a sensor. This tells the NXT firmware which device driver it needs to run for a particular sensor port. It's a function that is the same as doing an assignment to "SensorType" variable.

"SensorQuaDEncoder" and "SensorFullCount" are unique variables for the VEX / IFI version of ROBOTC. They should be invisible in the NXT / FTC version.

If you really want to set up the sensors manually in your code you can. You should be able to find a few examples in the sample program folder.

If you want to see the code that is generated in the prolog code you can also see that. You may have to be in "Expert" Menu Level mode. Use the "F9" key to get a dis-assembly listing of your program. Look for the assembler code for the main task.

Who is online

Users browsing this forum: No registered users and 2 guests

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