Questions tagged [pybricks-micropython]

14 questions
2
votes
1 answer

Send Data between EV3 and PC

I am programming a roboter, and it needs to send data between the EV3 and my laptop (Windows) I run pybricks on the EV3, which enables me to code in python. I already did research, but the only things that are remaining are some blogs from 2014 that…
2
votes
1 answer

How does the stalled() function work in Pybricks-MicroPython

MicroPython 2.0 beta 5 Trying to understand how the stalled() function on the motor works. I run a motor at dc of 100, and hold the wheel so that it cannot move. But the stalled function doesn't fire, indeed whatever I do I don't seem able to get it…
1
vote
1 answer

Threading on EV3 micropython

I am trying to write some code for my EV3 brick. I am really struggling to get multithreading to work. I am using threading module, it throws no error but function that are supposed to run on another thread aren't run at all. My code: …
1
vote
1 answer

Intellisense doesn't recognise the motor class of pybricks, but everything else

I want to code with pybricks and so far, everything worked, except of the Motor class. I use Visual Studio Code. This are the imports: from pybricks.hubs import EV3Brick from pybricks.ev3devices import ColorSensor from pybricks.ev3devices import…
1
vote
1 answer

Drive function in MicroPython for LEGO EV3

I'm trying to understand the functions from DriveBase class from MicroPython for EV3. I instantiate the DriveBase object like this robot = DriveBase(left_motor, right_motor, wheel_diameter=55.5, axle_track=104) When I run robot.drive(speed, angle)…
1
vote
2 answers

How do I get immediate response between motors and sensors?

I am new to pybricks and have found very little documentation to help answer my own query. I have written what I thought would be a simple program to spin my robot on the spot until the UltrasonicSensor sees something. It will then push forwards. If…
1
vote
1 answer

Using Python I need a Concurrently While Loop with a PS4 Controller Event Loop

Using Python I want to run two loops concurrently. The first is a regular while loop. The second is a while loop based on file events from a Bluetooth connected PS4 controller. The two loops need to know what the other loops are up to. Here is the…
Adam
  • 125
  • 1
  • 12
1
vote
1 answer

UART communication in ESP-12E

I am using micro python in same board to start a serial communication from machine import UART uart = UART(1, 9600) uart.init(9600, bits=8, parity=None, stop=1) uart.write('abc') and reading serial data using usb to serial…
1
vote
1 answer

random in MicroPython does appear to do anything?

Using pybricks-micropython Running this command to get a random port number, works under CPython. import random port = random.randint(50000,50999) produces a number, only it is hardly random it is the same number each time I run the script. I am…
user3069232
  • 8,587
  • 7
  • 46
  • 87
0
votes
1 answer

Can't connect RFCOMM socket: Connection refused. GDBus.error:org.bluez.error.failed:Protocol not available

I'm trying to connect a lego ev3 with micropython to a raspberry pi via bluetooth. Installed bluez and blueman on raspberry. I made the lego address trusted and connected it via the command line using sudo rfcomm connect hci0
. The pairing…
0
votes
0 answers

microPython - simon game - problem with clearing an array

I'm building a Simon game using lego's ev3 and microPython. My code is attached underneath. I think I have a problem with each iteration emptying my array of pressings. Thanks #!/usr/bin/env pybricks-micropython from pybricks.hubs import…
0
votes
0 answers

Error called on mqtt.publish after a while of running the program

Traceback (most recent call last): File "", line 115, in wind_Speed_Pulse File "", line 65, in publish_Wind_Speed File "umqtt/simple.py", line 134, in publish OSError: [Errno 104] ECONNRESET '''Import Libraries''' from machine…
0
votes
1 answer

Can you use events or interrupts with EV3 micropython?

I am attempting to write a program for a LEGO Mindstorms EV3 brick that requires actions to be taken when a specific input is recorded by the sensors. As far as I can tell, the only way to do this in EV3 micropython / pybricks is by busy-waiting.…
0
votes
1 answer

Is there a Bug in motor.run_target command?

MicroPython 1.0.0, ev3dev Linux echo 4.14.96-ev3dev-2.3.2-ev3 #1 PREEMPT Sun Jan 27 21:27:35 CST 2019 armv5tejl GNU/Linux #!/usr/bin/env pybricks-micropython from pybricks import ev3brick as brick from pybricks.ev3devices import Motor from…
user3069232
  • 8,587
  • 7
  • 46
  • 87