The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [programming]

Questions about programming the various LEGO programmable bricks, including Mindstorms (EV3, NXT, and RCX), Wedo and Scout, in either the provided languages and editors, or more advanced languages.

Filter by
Sorted by
Tagged with
4
votes
3answers
1k views

Which programming environments or APIs are available for the lego BOOST?

Over the holidays I tried the following Python library: https://github.com/undera/pylgbst but I couldn't get it to work. Then again my knowledge of Python is very limited. I'm more experienced with C+...
5
votes
1answer
113 views

How to mirror an EV3 motor?

I want to get one EV3 large motor to copy the other. So if I move one half a rotation the other copies.
2
votes
1answer
70 views

How to distinguish between objects using a sonic sensor?

I am trying to find a ball in the field, grab it, and drop in the specified area. I'm using an ultrasonic sensor on the front of the robot. My current solution for locating the ball is: Turn ...
7
votes
2answers
630 views

Ultrasonic problems with the red and blue balls?

I'm still new to NXT, I try to make the robot locate a ball using the ultrasonic sensor, while there I should be in a square area marked by white color. How can I make the robot locate the object (by ...
2
votes
3answers
4k views

Programming NXT color sensor with NXC?

Currently I am working Lego robot that solves 2x2x2 Rubik's cube. I am programming Lego Mindstorms NXT 2.0 color sensor in BricxCC. I already have RGB data with the command ReadSensorColorRaw. I ...
5
votes
4answers
9k views

EV3 Brick Error Symbols?

I am currently developing an EV3 robot that sorts colored technic beams. However, the brick will only run part of the program and then generate a strange error code on the brick's screen. The error ...
0
votes
0answers
36 views

T-R3X the look My Block problems [duplicate]

OK I am making the look My block for the T-R3X program but there is this block which don't know how to make at the end of the diagram in the book.
7
votes
4answers
12k views

How to program two NXT motors to run at the same time?

I'm working on a project with multiple axis of movement… trying to get two motors to run at the same time in order to achieve a mix of two!
3
votes
3answers
324 views

Could not open serial port or USB device

I am trying to use my old RCX 2.0 set on Linux (Xubuntu). The problem is that when I try to download the (official) firmware into the RCX via the command: nqc -Susb:/dev/usb/legousbtower1 -firmware ./...
8
votes
5answers
9k views

Is it possible to edit a my block input parameter value?

I have created my blocks but want to change the input parameter to a negative. Is this possible or must all the myblocks be re-written?
1
vote
2answers
103 views

What does this symbol on the EV3 Brick mean?

I can’t figure out how to get my R3PTAR to open and close it’s mouth to bite. I keep getting this symbol. What does it mean?
0
votes
0answers
44 views

Using switch block with Hitechnic color block

Can I compare the Hitechnic block --> measure --> color output in a switch block? For example, if the Hitechnic color sensor is seeing black, then do something, else do another thing. If not, then how ...
0
votes
0answers
34 views

Are there any coding platforms for my NXT available for my IPad?

Can anyone tell me any app on the App Store so I can program my NXT? Please let it not be one of those ones that you have to pay or one of those that are just controllers. Thanks for your help.
2
votes
0answers
59 views

Rearing off to the left without telling it to

I've started to build a robot, but when it drives it veers off to the left even though I'm just telling it to go straight. I think I need to do something to the motors but I don't know what or how. I'...
0
votes
0answers
46 views

LEGO train 7898 Arduino Library?

So I want to control the green 7898 train with an Arduino, but the library I have installed doesn't support this specific train. My question is if anyone knows a library that does?
0
votes
2answers
110 views

Can't link variable inside a switch when creating a new block

I have a problem when connecting the variable (from the create a block) to a variable in the function because it's inside a switch. How can I link them? I want to connect the variable to each (20) in ...
0
votes
1answer
115 views

Using two color sensors simultaneously

I am new to the world of robotics, and I'm preparing a new project with my students. Our goal is to make a self driving robot that can read colored signs from the road in order to turn right or left a ...
1
vote
0answers
59 views

iNXTG app programming NXT from ipad

I'm trying to find the old iNXTG to program NXT bricks via iPad but it is no longer available in the Apple Store. Does anyone know if there exists an archive for programs like that? The problem is ...
1
vote
1answer
60 views

Unsure of how to use a switch that is time dependent

Have been trying to make a line follower that can autocorrect itself if it would lose the line. The follower is supposed to turn around, go forward and catch the line if the line has not been detected ...
0
votes
1answer
51 views

using a remote control

I have just started to get into using a LEGO Mindstorms EV3 robot. I know you have to create a program on the laptop, then it has to be downloaded to the EV3 block. Can you use a remote control to ...
2
votes
3answers
158 views

EV3 Multiple conditions: wait sensor activation for N seconds or

How to program EV3 to wait for a sensor activation for at most X seconds? If the sensor is activated in the given time, begin sequence B. If it is not activated in X seconds, begin sequence A. ...
1
vote
0answers
81 views

Function in EV3 Basic

I have been programming in basic for ~30 years. I want a translation of the following code into EV3 Basic: function index( x , y ) return x + y * ( maxx , + 1 end function sub look for i = 0 ...
3
votes
2answers
315 views

How To Plug Detected Light Values into Variables and Still be Usable in Programs in EV3-G

I've seen teams, mostly in the world festival do this, and what they do is they program the robot so that when a brick button is pressed, the robot detects a value (usually RLI) and it is used later ...
0
votes
1answer
124 views

How I can program a solar panel heliostat? [closed]

I want to make a program for an EV3 solar heliostat. It consists of two motors and a color sensor. I want it to follow the light. The station is fixed. EV3SolarStation pdf
6
votes
1answer
910 views

Where can I find documentation on the LEGO Wireless Protocol for Powered Up devices?

LEGO BOOST and LEGO Powered Up Smart Hubs use Bluetooth Low Energy to communicate to apps. Where can I find documentation on the communication protocol so that I can build my own app for these devices?...
4
votes
2answers
183 views

Is there any way to find misplaced bricks in LEGO NXT Programming?

I am working on a Mindstorms NXT project. Due to annoying bug (cannot find terminal hotpoint thingy) I can't delete a specific block, and if I do so, part of the program will be cut off from the main ...
4
votes
1answer
619 views

NXT Programming not working

I recently got back into NXT stuff (keep in mind I have a NXT 1.0). My screen was broken, but I got it fixed. The software works, but I think the programming doesn't. I tried to make the motor move ...
4
votes
1answer
143 views

NXT brick not executing programs correctly

I have an issue that I am hoping someone might be able to resolve: We're using Mindstorms in the classroom as part of a STEM program, and have one NXT brick that won't execute programs correctly. The ...
1
vote
2answers
2k views

How can I create custom EV3 blocks?

What do I need to create custom blocks and in particular the VIX part?
1
vote
1answer
130 views

Program for NXT golf robot not looping properly

This is what I made: I will put this robot straight in line with the ball I have to make this robot go forward and once it reaches the ball, I have to make it stop and hit the ball with the swing ...
4
votes
3answers
3k views

What is a normal range of reading of the Light Sensor using EV3 Raw Sensor block?

EV3 software does not support the Light Sensor. It does support the Color Sensor. The solution is to use the Raw Sensor Block. What is "normal" for raw sensor block readings? I'm getting readings ...
2
votes
2answers
177 views

How to make an exact 16 degree turn?

Does anyone know how to make an exact 16 degree turn with a LEGO robot?
8
votes
4answers
13k views

How can EV3 Gyro sensor drift be handled?

EV3 robots can use a Gyro sensor to determine the direction the robot is heading. The initial conditions are important. The sensor needs to be still and then the sensor reset. However, once in a ...
6
votes
1answer
608 views

Is it possible to use 5 motors on an EV3 brick?

The EV3 brick has only four output ports (A B C & D) to run motors. Is there any way to use port 1 (sensor port) to control a motor?
2
votes
3answers
351 views

How to retrieve a deleted program file from the lego NXT

I have been programming a complex file for my lego NXT. I accidentally deleted my file from the PC, but it is still available on my NXT brick. Is there any way that I can retrieve the file from my NXT ...
5
votes
1answer
1k views

How to build an automatic Lego train system?

I was wondering if anybody has ever tried using the IRLink NXT sensor to make an automated train system and if so, what kind of setup did you have to make it all work? I have been working on a train ...
1
vote
1answer
82 views

How to send through Bluetooth motor angle position and mirror that position on another motor?

I've built a steering wheel that checks the servomotor position using NXC function - MotorRotationCount(). Now, I want to send that position to second brick using Bluetooth and apply that servomotor ...
2
votes
1answer
95 views

Stepping through Mindstorm program

The code does not do what I think it should. It is frustrating to tweak it, download it, run it from the block, and find that once again, it does not do what I think it should. Is there some way to ...
1
vote
1answer
188 views

EV3 does not react to commands (sent via bluetooth) after 1.7 seconds

Short description: I want to send commands via bluetooth to an EV3 brick from a Linux computer. I use python to send bytecodes via bluetooth and not any EV3-specific software Pairing the device was ...
9
votes
1answer
4k views

How can I rotate an EV3 motor an exact number of degrees using RobotC?

I'm trying to rotate the motor of an EV3 by an angle of 50°. I can't. How I can rotate a NXT/EV3 motor by a given angle using RobotC?
5
votes
2answers
235 views

How can I program a motor to rotate towards the source of sound?

I have 3 sound sensors and a motor connected to four ports of the same brick. My motor should rotate by some angle towards the highest sound detected by the sensor, how do I write an infinite loop ...
0
votes
0answers
408 views

Loop interrupt stops all loops, not just the one designated

I have been using loop interrupts for a while, and not had an issue... until now. And it is driving me nuts. The program has 2 main loops, titled "touch" and "end" with two more nested in the "touch" ...
2
votes
1answer
301 views

How do you interrupt a MyBlock?

I have a "general-purpose" line-follower encapsulated in a MyBlock that runs an infinite loop. Now, in a client program, I would like to interrupt that MyBlock if some condition is met; what the ...
3
votes
1answer
1k views

EV3 Block problems?

I don't see what is wrong with the way i made my program. It looks like this. The idea is that in the while loop [01] shall the robot move forward until it see something brown. If it see ...
2
votes
1answer
3k views

Can you extract a program from the EV3 brick to the computer?

As part of an assignment, I made a program for my EV3, but however my computer automatically restarted, so I lost that program. I need to show the program! However, the program is still in my brick. ...
3
votes
3answers
334 views

Access WeDo on OS X from a real programming language

I'm trying to talk to the WeDo USB interface from Python or really any real programming language. I tried the clever WeDoMore library, but can't get it to bind the WeDo. I think this is because the ...
2
votes
1answer
544 views

What is a better algorithm for wall following with an ultrasonic sensor?

This wall following algorithm uses the ultrasonic sensor. It has a horrible worst case behavior. Place the robot about 3 cm too far from the wall. Instead of moving closer to the wall, the robot ...
4
votes
1answer
161 views

LEGO MINDSTORMS EV3 Can't find MyData Block

While going through the challenges of the Gyro Sensor Investigation I came upon the issue that I do not have the MyData Block (It's a dark blue block with a graph on it) on the coding program. Could ...
3
votes
1answer
1k views

Can EV3-G MyBlocks be recursive?

Imagine I create a MyBlock called function1 from a line of blocks. Can I call that block from within itself? This is the program for the block recursiveTest. Will this block function properly?
4
votes
3answers
8k views

Invert motor block in EV3

New to EV3 so this should be simple. I would like my simple wheeled robot to go backwards. So I put two invert motor blocks, one for port B the other for port C followed by a move steering block. The ...