Questions tagged [robotc]

RobotC is a c-like language used for an introductory in programming robotics.

RobotC is a c-like language with some mix of c++ used for an introductory in programming robotics. It is used to program Vex Robots(IQ + Cortex), and Lego robots(NXT + EVE3).

Resources

Main website: http://www.robotc.net/

Documentation: https://www.robotc.net/WebHelpVEX/

Unofficial Forum: https://www.vexforum.com/

Note, the original forum has been taken down

29 questions
0
votes
1 answer

How to program line following and vex claw bot to autonomously pick up pipe on RobotC?

Our teacher gave us an assignment which is supposed to be self-taught via YouTube. I can't find a good tutorial, so can anyone explain to me how one would program a vex claw bot to move straight until it finds a line and begins to follow the line…
Taha Ali
  • 3
  • 1
0
votes
3 answers

How to make what function I use in c be controlled by a variable

This is my first year of vex. I am taking on the role of programmer. I have had this idea for rapid autonomous creation, recording the driver. Instead of the usual array/debugger dump of raw streams of power levels, I had the idea of extracting…
Theol0403
  • 3
  • 1
0
votes
1 answer

RobotC Sonar Sensor Array

I am using a sonar sensor to create an obstacle avoiding robot. The robot needs to be able to check 180 degrees in front of it, so I have made a "head" the sensor is mounted on that is attached to a motor with an axle that runs through a…
Kharonos
  • 17
  • 8
0
votes
2 answers

Why is my nested while loop not working?

I'm currently programming in RobotC, for a Vex 2.0 Cortex. I'm using encoders to make my robot go straight. This is my code: void goforwards(int time) { int Tcount = 0; int speed1 = 40; int speed2 = 40; int difference = 10; …
nosn
  • 127
  • 1
  • 1
  • 6
0
votes
2 answers

switch and if statement order (Robot C)

I'm writing practice finite state machine code and can't wrap my head around the order of my "Switch" and "if" statements (which should come first). Currently, I have it written as such: task main() { // State variable default. …
Ben
  • 59
  • 8
0
votes
1 answer

ROBOTC - Programming Autonomous With Integrated Encoders

I have an X Drive that is coded in ROBOTC. My team and I have the integrated motor encoders already on the robot (for the autonomous period). However the code for them to run is incorrect. The current autonomous code is below. When I run it, it just…
0
votes
1 answer

Serial communications between PySerial and VEX EDR Cortex

I have been struggling with this for the last 24 hours, I am trying to get PySerial to talk to a VEX Cortex over bluetooth using UART / HC-05. I guess this would be very similar to communicating with a Arduino. The devices are connected together…
Burf2000
  • 5,001
  • 14
  • 58
  • 117
0
votes
0 answers

What is the nPrecision parameter of RobotC displayLCDNumber?

Vex ROBOTC has the following command for displaying integers to the LCD display: displayLCDNumber(nLine, nPos, nValue, nPrecision); I'm trying to display the following: displayLCDNumber(0, 4, (float) 3.14159, nPrecision); Supposedly, using the…
Ashwin Gupta
  • 2,159
  • 9
  • 30
  • 60
0
votes
2 answers

Controlling ports in a loop using Vex RobotC

I am using Vex RobotC and have a function: setTouchLEDRGB(portx, R,G,B); which sets the RGB colour of a touch LED. I have 9 TouchLEDs and want to change the colour of them all at once, now annoyingly this is 9 lines of code at a time, i hope to…
Andrew O'Rourke
  • 127
  • 1
  • 9
0
votes
1 answer

ROBOTC: Why do #pragma config() preprocessor directives have to be the first lines of the source file?

I'm a tutor for an undergrad class in robotics, and we use robotC (for NXT robotics, version 4.50) as the platform of choice. A strange quirk in robotC that I've noticed is that, for some reason, #pragma config preprocessor directives only work when…
0
votes
1 answer

turning radius is inaccurate of the robot is inaccuarate

#pragma config(StandardModel, "RVW SQUAREBOT") task main(){ int begindistance = SensorValue[sonarSensor]; while (SensorValue[gyro] < 900){ motor[leftMotor] = 20; motor[rightMotor] = -20; } motor[leftMotor] = 0; motor[rightMotor] =…
MSG2
  • 9
  • 2
-1
votes
1 answer

Integers and scopes

If I declare integers before task main() in ROBOTC those integers would be in the global scope? Therefore, I would be able to call them out at any time; however, I plan to create other tasks and void functions before my task main(). Would the…
EnlightenedFunky
  • 303
  • 1
  • 13
-2
votes
1 answer

ROBOTC: Talking to EV3 brain from Android app developed in Xamarin through Bluetooth

This one's a doozy: I'm developing an Android app in Xamarin which will send messages to an EV3 brick running ROBOTC. Anyone think they could help me with this? I understand that NXT bricks can use sendMessage(); but I'm using an EV3, and can't find…
-3
votes
2 answers

How to catch when a float = -1.#IO

I have a problem in my RobotC code where when a float reaches infinity it returns -1.#IO This is the value that is returned if a float reaches -Infinity. So the problem is float can only use numerical values. I cannot catch this value. If I put if…
skyline
  • 51
  • 9
1
2