View unanswered posts | View active topics It is currently Thu Apr 17, 2014 11:32 am

Reply to topic  [ 5 posts ] 
Can You Help Me??? 
Author Message

Joined: Mon Sep 17, 2007 5:31 am
Posts: 28
Location: Indonesia
Post Can You Help Me???
Hello Friend???
Can you help me???
can you give me more detail about function of component at robot c...
if can,can you give me the example???
because,i'm not too understand about component robot c and the explaining about component not detail only telling not with example...
thank you so much...

Mon Sep 17, 2007 5:55 am
Profile YIM
User avatar

Joined: Wed Jan 31, 2007 3:39 am
Posts: 299
Location: San Diego, California. USA
To look at a description of each component, double click on a category in the Code Templates Toolbar. It will give you a explanation and examples of the different components.

Also, make sure that you are in expert mode. To change this go to Window/Menu Level/Expert in the menu

Hope this helps
Scott B-)

Mmmm Legos B-)

My Robot Projects:

Mon Sep 17, 2007 11:34 pm
Profile WWW

Joined: Mon Sep 17, 2007 5:31 am
Posts: 28
Location: Indonesia
Post thanks...
something I do not understand...
example : nmotorPIDSpeedCtrl. it say for regulation...
regulation for what???

Can you give me a simple program,how to save data at nxt???
for example:I want to save number intensity of light sensor...
thank you very much...

Tue Sep 18, 2007 1:50 am
Profile YIM
Site Admin
Site Admin

Joined: Wed Jan 24, 2007 10:44 am
Posts: 438
Location: Pittsburgh, PA
nMotorPIDSpeedCtrl regulates the speed that you set. Normally, a motor will not run perfectly. If you set it to 50, it will try to go 50, but there are instances where the gears have friction, or some other design issue and regulating the motor power will ensure that the robot is going with the motor power level that you set.

nMotorPIDSpeedCtrl[motorC] = mtrSpeedReg;

This will enable Speed Control for motor C. All you need to do now is to set a power level for motor C. If you would like some tutorials, please go to the main site, and go through the Preview for Teaching ROBOTC for Mindstorms. It contains many examples and walk-throughs to show you the basics of how to program and use ROBOTC.

If you want to save data, you can use a variable to store the value.

Variables have types. For example:

int - for integer
float - for numbers containing decimals
string - for a string of characters
boolean - for boolean "true" or "false" values

An example of storing of a value would be this (assuming you went to ROBOT > MOTORS AND SENSORS SETUP to set up your "lightSensor"):

task main()

    int lightValue;
    lightValue = SensorValue(lightSensor);

    if(lightValue < 45)
        motor[motorC] = 50;
        motor[motorB] = 50;
        motor[motorC] = -50;
        motor[motorB] = -50;

    motor[motorC] = 0;
    motor[motorB] = 0;

This is a simple program. When run, it takes the current value that the light sensor is reading, then it compares that value to 45. If it's less than 45, it will go forward for 2 seconds. Otherwise, it will run backward for 2 seconds.

Vu Nguyen
Software Training Development Team | Webmaster
Need more support? Use the ROBOTC Ticketing system| Robomatter Store | Robotics Academy | CS2N

Tue Sep 18, 2007 9:18 am

Joined: Mon Sep 17, 2007 5:31 am
Posts: 28
Location: Indonesia
Post thanks vnguyen
thanks for answer my question...
I mean if I run the program and I save data of light sensor and then after I run,I turn off the nxt and then I turn on again,and I need the data that I already save...
how can I make it???
for example : I run a program and then I save data sample of light sensor...and after I turn Off the Nxt I turn On again and I need my data sample of light Sensor again...
How can I make the program???

Wed Sep 19, 2007 12:27 am
Profile YIM
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: Siberianice 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.