View unanswered posts | View active topics It is currently Tue Jun 19, 2018 6:21 pm

Reply to topic  [ 5 posts ] 
Author Message

Joined: Thu Nov 06, 2008 11:12 am
Posts: 2
Post encoders...
i understand absolutely nothin about encoders....

any help?

Thu Jan 08, 2009 10:09 pm
User avatar

Joined: Fri Nov 09, 2007 4:51 am
Posts: 121
Location: Hungary, Europe
Post Re: encoders...

Encoders are built in the NXT motors to provide information about the axle position.
In the RobotC programs you can check the encoder value, which is measured in classical degrees.
I.e., a change of 360 in the encoder value means a complete turn of the axle.

Or, are interested in the physical implementation of these encoders...?

Fri Jan 09, 2009 6:54 pm

Joined: Thu Nov 06, 2008 11:12 am
Posts: 2
Post Re: encoders...
Hello Elmes,

So i know that it is more or less a sort of rotation sensor. Our team builders with instruction of our coaches have put the encoders on our motors and the next step is learning to program them. (which is where i come in) I don't understand how to program them and i don't understand the whole pragma stuff.. I've just started learning the robotc programming language. :shock: Any help you have to offer is much appreciated.


Mon Jan 12, 2009 11:35 am

Joined: Wed Jan 07, 2009 7:27 pm
Posts: 5
Post Re: encoders...
Hello lp6813, welcome to the world of RobotC., take a look at section 3, both the sample programs menu and videos. They have plenty of examples to learn from, the Pragma function links a variable name like LightSensor to a sensor, so it can be easily referred too. The declaration format (how you write the code) is like this

#pragma config(Sensor, <S1, S2, S3, or S4>, <Name you want for the Sensor>, <Sensor Type>)

so to configure a Touch, Light, Sound, and Sonar sensor
#pragma config(Sensor, S1, TS, sensorTouch)
#pragma config(Sensor, S2, LACT, sensorLightActive)
#pragma config(Sensor, S3, SND, sensorSoundDB)
#pragma config(Sensor, S4, PING, sensorSONAR)

but an easy way to set it up is to use the wizard, click on Robot -> Motors and Sensors Setup, and then just set it up, its pretty intuitive.

Wed Jan 14, 2009 7:56 pm

Joined: Fri Sep 19, 2008 1:22 am
Posts: 200
Post Re: encoders...
It sounds like you are an FTC team. You will get better/faster answers to your questions if you post to the FTC part of the forum. The shaft encoders for the Tetrix 12V motors are used exactly like the built-in encoders for the LEGO motors. In other words you use the nMotorEncoder[] and nMotorEncoderTarget[] arrays. I suggest reading the documentation and looking at some of the sample programs that come with RobotC to learn about how to use the encoders.

Jeff McBride
Benson Robotics Club

Wed Jan 14, 2009 11:22 pm
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests

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.