View unanswered posts | View active topics It is currently Mon Dec 22, 2014 12:34 am






Reply to topic  [ 3 posts ] 
RobotC commands/syntax 
Author Message
Rookie

Joined: Mon Feb 04, 2008 3:01 pm
Posts: 5
Post RobotC commands/syntax
Does anyone know the programming format for the commands:
-SetSensorType;
-SetSensorMode
-SensorQuadEncoder;
-SensorType
-SensorFullCount
etc.???

Thanks!
2609


Sun Apr 06, 2008 4:56 pm
Profile
Expert
User avatar

Joined: Sat Sep 20, 2008 12:16 pm
Posts: 106
Location: Curently fighting aliens on P3X-828
Post Re: RobotC commands/syntax
Have you checked the sensors menu in the help files?

_________________
:downloading:
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
Profile WWW
Creator
Creator

Joined: Fri Feb 09, 2007 9:21 am
Posts: 615
Post Re: RobotC commands/syntax
guopeter wrote:
Does anyone know the programming format for the commands:
-SetSensorType;
-SetSensorMode
-SensorQuadEncoder;
-SensorType
-SensorFullCount
etc.???

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.


Sat Sep 27, 2008 4:05 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


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

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.