/r/RobotC

Photograph via snooOG

ROBOTC is the premiere robotics programming language for educational robotics and competitions. ROBOTC is a C-Based Programming Language with an Easy-to-Use Development Environment.

ROBOTC is a robotics C-Based Programming Language for educational robotics. We work with VEX, VEX IQ, EV3, NXT, Robot Virtual Worlds, and Arduinos.

Other Useful SubReddits:

/r/RobotC

226 Subscribers

1

Gray is doing some grave keeping.

1 Comment
2024/07/01
13:26 UTC

1

Error while installing the software

hey guys , im trying to install the software for my upcoming exam i have on the robotc lego for mindstorm . it does this error and when i press ok , the install is complete but working bad and alot of feature missing like virtual worlds packages not appearing , and an error appearing on screen when i download the code to the robot .

what do i do ?

thanks

tried installing in 3 different pcs and all of them are encountring this message .

https://preview.redd.it/kg9usi7tm6kc1.png?width=1173&format=png&auto=webp&s=18d2b55049121b85c03cedf442f6e1db29d1bdf4

0 Comments
2024/02/22
18:44 UTC

2

question about ROBOTC programming

I am new to ROBOTC but I have to make a vex robot project for school and our teacher is on leave and i couldn't find any answers on Google but how do I make a code for a line follower? If I have 3 line followers 1 on the right, left and center. I want to make a code so if there is a right or left turn the robot will turn UNTIL the center tracker sees the tape so that it is aligned but I don't know if that is possible.

0 Comments
2024/01/11
16:34 UTC

1

Old version downloads

RobotC used to make all of its old versions public on its download server, downloads.robotc.net. However, the server has been taken offline since around mid-2020, when the site went through a massive overhaul. Most of the versions have been archived through the WayBack Machine, but some, such as 4.27 have not. I was just wondering if anyone had been archiving old version files and has the installation files from the currently missing versions.

0 Comments
2024/01/03
16:32 UTC

1

nFileIdenticator

Hi,

we want to accses a file on the EV3 Brick using the File Accses system from RobotC. All functions require "nFileIdenticator". Type says it is a parameter of type 'long'. What is this? I coundn't find anything in the web help files.

0 Comments
2023/12/02
21:13 UTC

1

How to create Logfiles?

Who has experience with creating log files in robotc? We have looked at the example files - but after that we did not find a file to download on the Brick (EV3).

Thanks for any help.

Kind regards Team Robo-Hunter

0 Comments
2023/06/08
09:24 UTC

1

How to use until commands

i cant get my until command to work i’m trying to make it so once a limit switch is pressed it will start the right motor can anyone help me out

0 Comments
2023/05/10
15:37 UTC

1

HELP PLEASE

I cannot figure out how to write code for this problem:

Touch the limit switch to start right motor at -95.25 for 5 seconds, then stop the motor

Nothing is working

3 Comments
2023/05/10
00:15 UTC

1

Function Pointers For Structures

Hello everyone!

So I am doing some projects via RobotC, and for optimization, I wanted to define functions that I have in the structure to be restricted outside the structure.

in normal C you would create a pointer in structure "struc" like so:

void (*some_function)(int a, int b);

then when having some function "FUNC" outside the structure, you would go and do the:

struc.some_function = FUNC;

and later you could do the following:

struc.some_function(a, b);

But I could not implement the same idea in RobotC. For some reason, I am getting loads of errors.

Can someone help me? It would be greatly appreciated!

Thanks in advance!

0 Comments
2023/04/09
16:30 UTC

1

lineFollower sensor values too low

-VEX 2.0 Cortex -Natural Language PLTW

I'm doing a simple project where my groups bot has to follow a 1/2 black tape line on the floor. When running the programme, the lineFollower sensor values that are appearing max out at about 250-260 when to my knowledge they should be well into the 1000's. Adjusting the sensors' distance above the floor/line has not made any difference. After reading through the VEX forum a little bit seeing a poster who had the same issue, most of the replies narrowed down to the sensors being either too old or faulty. There are no code errors caught in the compiler but there may be something wrong with it that I'm not aware of. Is it more likely that the sensors themselves are the issue or is there something else that I need to do differently?

Screenshot of the code

0 Comments
2022/05/26
14:33 UTC

1

Alternative(s) to ROBOTC Robot Virtual Worlds for VEX?

The software's general idea is extremely appealing, but its price combined with its limitations (mainly the limited choice of robot pre-sets and lack of sensors) really doesn't make me inclined to ever use it. Are there any known alternatives that would allow me to test/run code I've written in RobotC or otherwise without a physical bot? Any input would be helpful.

0 Comments
2022/05/26
03:06 UTC

1

Help Please

hello! i’m doing a project where i have three touchLEDs and a bumper switch. the touchLEDs have to go from green to yellow to red and back down and continue until i press the button. then it should immediately go red for 5 seconds then continue the pattern it was on but i’m rlly struggling and don’t understand what i’m doing wrong. i will post the code tmrw. currently the light stays in green and goes to red automatically but doesn’t go through the sequence. any advice would be much appreciated :) thank you

0 Comments
2022/04/01
01:34 UTC

1

Is there a way to stop the timers? I’m trying to stop the timer when linetracker2 gets activated but I can’t find anything that works. (Neutral language pltw)

0 Comments
2022/03/21
15:26 UTC

1

Hi would this code make it so that if the bot is going in a straight line and veers off to the left or right it will return to 0 degrees the motors are in reverse hence the negative values

4 Comments
2022/02/25
19:54 UTC

2

Need Help Programming

I was tasked with building a claw machine out of vex oarts (like the ones in arcades where you win prizes) but am having trouble programming the controls. I made a controller with 5 buttons for movement (up down left right and drop claw) but I cannot get the programming right.

I have tried using untilBump and untilRelease for them to start the motors but both of those require me to press the buttons in a specific order (order they are coded) and won’t run the program for a button later on in the code until the first one is pressed.

Any help on this would be appreciated, been trying to rack my brain around it for a while.

3 Comments
2021/12/06
14:29 UTC

2

Does anybody know where i can download robotC for free for lego mindstorms on version 4.X?

The tittle says it all, i would apeciate if somebody can help me, thank you very much

0 Comments
2021/03/10
10:08 UTC

2

i think robot c works on wine now

i was able to download and run it and get to the editor i have never used robot c before but i think it works

0 Comments
2021/01/27
21:09 UTC

2

Looking for Tutor

Anyone that is experienced in RobotC want to tutor me? :p

0 Comments
2021/01/18
08:30 UTC

1

how to make my robot turn cleanly

the title

0 Comments
2020/11/12
09:48 UTC

3

Can you guys help. I need to do this for a school project and the ''stop both motors'' doesnt give me a time for them to be stopped. It would be great if you guys could help even if something else is wrong. Thank you in advance for the input.

3 Comments
2020/04/14
18:10 UTC

2

Joystick

Hey guys,

I've been trying to control one motor with the joystick channel 2 and the buttons 6U and 6D. (the same motor for both controls).

This is the code I have, but when I use it, my motor doesn't work.

<

\#pragma config(Motor,  port2,           LeftMotor,     tmotorVex393\_MC29, openLoop, reversed)

\#pragma config(Motor,  port3,           RightMotor,    tmotorVex393\_MC29, openLoop)

\#pragma config(Motor,  port4,           FrontMotor,    tmotorVex393\_MC29, openLoop)

\#pragma config(Motor,  port5,           BackMotor,     tmotorVex393\_MC29, openLoop)

\#pragma config(Motor,  port7,           RotateMotor,   tmotorVex393\_MC29, openLoop)

\#pragma config(Motor,  port8,           LiftMotor,     tmotorVex393\_MC29, openLoop)

//\*!!Code automatically generated by 'ROBOTC' configuration wizard               !!\*//

task main()

{

while(true)

		{

// la base

motor[LeftMotor] = vexRT[Ch3] - vexRT[Ch4];

motor[RightMotor] = vexRT[Ch3] - vexRT[Ch4];

motor[FrontMotor] = vexRT[Ch3] + vexRT[Ch4];

motor[BackMotor] = vexRT[Ch3] + vexRT[Ch4];

// le bras avec les chanels 1 et 2

motor[RotateMotor] = vexRT[Ch1];

motor[LiftMotor] = vexRT[Ch2];

//le bras indépendamment

if(vexRT[Btn6U] ==1)

{

motor[LiftMotor] = 127;

}

else if(vexRT[Btn6D] ==1)

{

motor[LiftMotor] = -127;

}

else

{

motor[LiftMotor] =0;

}

}

		}

}

>

1 Comment
2020/02/15
14:21 UTC

1

We are having several problems with our Cortex and Joystick

The LED has been blinking for more than 20 seconds, and when we connect as follows: PC-->Joystick-->Vex Programming Kit-->Cortex The Cortex doesn't show any LED for the Robot LED and Game LED, but the VEXnet blinks red twice. Can anyone help us? Otherwise appears to be working..?

0 Comments
2020/01/17
00:40 UTC

1

After Line Tracking, How Can I Get my NXT to follow a line once I clap?

0 Comments
2020/01/05
22:12 UTC

1

NXT color sensor in RobotC

Hello how can i use a NXT color sensor so when it sees the robot imediatly moves backwards thank u

0 Comments
2019/07/15
18:10 UTC

1

Please help me with my project

Hello, I don't know if this should go in the r/robotc or r/vex forums but here I go...

So basically, what I want to do is make a "Start/Finish Line" program. What I need my vex to do is start when I press a button > turn on and off the 3 LED's> start the timer > turn on flashlights> wait until the lightsensor is blocked by an object (a.k.a the runner, a.k.a making it dark)> once the lightsensor passes that threshold> time is grabbed/ "recorded" by a given variable> once that happens the flashlights blinks until I stop the program (trying to make it like, OMOGMGOGMG YOU WON YAY YU'RE IN FIRST PLACE YAYAYYAYAYAY GOOD JOBBBBB!!!!!)

Now, my problem is that the flashlight, after the everything else before it goes, goes STRAIGHT to flashing, and the variable;e that's supposed to grab the time doesn't work. I tried if statements and until statements and played with the loop/while statements but it just doesn't work :<. Idk what to do anymore, I feel like the more I try to fix it and add more or remove, the worse it gets... Please, tell me what's wrong...

Thank you for your time :>

-Rye

Code of line:

task main()

{

int finishline; //variable for when *object* passes by the sensor

untilBump(bump); //triggers the start of the program (after i click start ofc)

turnLEDOn (red); 

wait(1);

turnLEDOff (red);

turnLEDOn (yellow);

wait(1);

turnLEDOff (yellow);

turnLEDOn (green);

wait (1);

turnLEDOff (green);



turnFlashlightOn (flash1); //these should stay on forever until something passes the sensor

turnFlashlightOn (flash2);



	clearTimer(T1); //timer starts

	waitUntil(SensorValue (sensor1) >=110); //waiting until something passes by it-making it dark

	finishline = time1\[T1\]; //grabs time

while(true){ //loop for the blinking lights

wait(1);

	turnFlashlightOff (flash1); 

turnFlashlightOff (flash2);

wait(1);

turnFlashlightOn (flash1);

turnFlashlightOn (flash2);

}

}// main //whY ISN'T IT WORKRINGINGIGION AHHHHHHHHHHHHHHHHHHHHH

0 Comments
2019/05/28
15:36 UTC

2

Is anything wrong with my program? Is anything wrong with my program? it will only run the right wheel motors.

1 Comment
2019/05/02
06:42 UTC

1

Any free versions of RobotC for EV3 above 4.10?

I've been looking for a free version of RobotC for EV3 above 4.10 that doesn't require payment, because that's too expensive, and it's not like i'm gonna use actual VEX equipment. I DID find a free version, but it's 4.10, which is very buggy and outdated. (Example: Back button doesn't work properly when multitasking)

0 Comments
2019/04/21
23:09 UTC

1

Need help with timers (Marble sorter)

I need to make a variable that is records a sensor value at a specific time after initialization. Is it possible to use timers to do this? Would I make it a static in order to keep it constant?

0 Comments
2019/04/18
19:26 UTC

1

How would i make a double tap feature for a bump switch?

I’m making an elevator and I would like to make a “double click” for a bump switch to signify to go down.

0 Comments
2019/04/05
04:01 UTC

Back To Top