Stack Exchange Network

Stack Exchange network consists of 174 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.

0
votes
1answer
39 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
61 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. ...
2
votes
2answers
44 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+...
1
vote
0answers
61 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
196 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
83 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
88 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
151 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
583 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
132 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
1k 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
82 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
140 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
10k 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
131 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
153 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
945 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
8k 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
68 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
59 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 ...
2
votes
1answer
180 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
123 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
196 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
238 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
226 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
1k 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
315 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
291 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
84 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
7k 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
465 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
207 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
750 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 ...
6
votes
4answers
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?
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 ...
40
votes
7answers
51k views

Is there any other way to program the Lego Mindstorms NXT other than the provided software?

I'm curious to know if there is any way to program the NXT other than the provided software. I don't necessarily have any issue with the software. Does the program created by the software translate ...
1
vote
1answer
723 views

A 90 degree turn with 56145

I'm making a program for my ev3rstorm and I want it to have a 90-degree spin turn. I use the standard part ev3rstorm wheelbase or rather, treadbase. Using the move tank block (I use that block all the ...
0
votes
1answer
52 views

NXT light sensor homework help

Read value from NXT kit using light sensor and show it in the middle of NXT screen. If measured lightness value is less than or equal to 50, right motor will stop and left motor will move with the ...
2
votes
0answers
216 views

Creating custom blocks using EV3 block developer kit

I am trying to develop a custom block using ev3 block development kit but i get nowhere. I created the XML files according to the documentation and the VIX file but it does not compile, I cannot ...
2
votes
1answer
313 views

EV3 Wired Brick to Brick communication

I'm currently working on a project for my intro to engineering class. As it stands now, one brick is running a LabView program to intake data from a 'barcode' and another brick runs a Matlab program ...
3
votes
3answers
2k views

My Blocks with return parameter

I have the retail EV3 kit and have created a function with in and out numeric parameters. While using the [in] params seem quite straight forward, it seems that I can only set the [out] param once. ...
7
votes
1answer
2k views

Pass sensor or motor port number as a parameter

I want to create a block for one light sensor or one motor separately. Is it possible to give the number of the port as a parameter to a sensor or motor block via data wire? In NXT-G it was possible.
0
votes
1answer
90 views

Bazooka blast ev3 Mindstorms using Python

I would like to shoot balls with the ev3 Lego robot. How can I code it using Python? Which components do I need for that and which function and motor use ?
5
votes
4answers
4k views

In lego mindstorm EV3, can you make the individual programs in a project into functions which can be used in the other programs?

The bit where you program what the robot does using your computer. I'm making a project and I can't fit it all onto the screen, so if you can't do functions, is there any way to zoom out of the screen ...
3
votes
4answers
4k views

What are the programming languages that can be used on Lego Mindstorm EV3?

My son is interested in robotics. For me, I would like maximum flexibility for programming. For my son, I guess something simpler would be preferable so that his interest is not killed by complexity ...