Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

4
votes
1answer
84 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
3answers
372 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+...
7
votes
5answers
8k 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
82 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
34 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
32 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
54 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
38 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
55 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
62 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
22 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 ...
3
votes
2answers
264 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 ./...
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
46 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
99 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
67 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
274 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
97 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
336 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
170 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
605 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
142 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
110 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
157 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
12k 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
351 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
268 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
981 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 ...
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 ...
1
vote
1answer
79 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
69 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
148 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
218 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
330 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
269 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
2k 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
327 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
426 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
129 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 ...
4
votes
2answers
2k views

Sort the program list on EV3

When uploading a project to the EV3 brick, is there a way to control the sorting order of the programs on the brick? E.g: Prog_1 Prog_2 Prog_3 ... When playing a robot match in FLL one often needs ...
5
votes
1answer
670 views

How to make Lego Mindstorms EV3 robot go in reverse when move steering input comes from proximity sensor

I saw an program on the Lego Education page which makes a Lego Mindstorms EV3 robot gradually slow down as it approaches a wall. The info from the proximity sensor is used as the direct wire input of ...
4
votes
1answer
225 views

Is code written for NXT bricks compatible with EV3 brick (for Johnny 5 building)?

My son is mad on the robot from Short Circuit (Johnny 5) and I want to build robots with him. We have a copy of Daniele Benedettelli's "Creating Cool Mindstorms NXT Robots" and I was planning to start ...
4
votes
1answer
805 views

Custom EV3 Block: “Unable to compile…” (“string subsection”)

I am attempting to make a custom block according to the EV3 Block Developer kit (found here). I was able to create a simple block that returns the length of a string. This is what it looks like: (The ...
2
votes
0answers
35 views

NXT Mindstorms software glitch

My FLL team was doing some practice programming exercises this morning. One group wrote a program using color sensors, no issue. The next group opened a new program window and attempted to open a ...