maarten-pennings / lego-mindstorms Goto Github PK
View Code? Open in Web Editor NEWHints, tips, and tricks for the LEGO Mindstorms products (RCX, NXT, EV3, Robot Inventor).
Hints, tips, and tricks for the LEGO Mindstorms products (RCX, NXT, EV3, Robot Inventor).
You describe how to use the right COM port and a terminal program. That's totally fine. But a way easier solution ist to run an IDE like µPIDE.
It works out of the box with the spike. It's auto detected (no com port fiddling) and you can browse the spikes file system, up- and download files and use REPL.
https://github.com/PeterStaev/lego-spikeprime-mindstorms-vscode
this is worth adding to your kb
cd ~/Library/Containers/com.lego.retail.mindstorms.robotinventor/Data/Library/Application\ Support/MINDSTORMS_ROBOTINVENTOR/
userSettings.json
Go to the end of the line/file, and add the following string properly: ,"ui.debug":true}
Mind the quote style and adding it into the json format to function.
Debug menu and new debug block functions to add
Hello Marten,
I am trying to connect the robot directly to the computer via bluetooth. I want to bypass mindstorms and pybricks applications. Do you know how should i do it?
Hi Maarten, I like the work you are doing with generators and iterators recently. I would like to share a program that I have been working on.
https://gist.github.com/dlech/973714729f33b67092b736f541820233
Here are some of the more interesting points:
I'm using zip
(built-in function) and zip_longest
(from itertools
in Python standard library) as some fundamental operators for running generators in parallel. This are somewhat analogous to Promise.race() and Promise.all() in JavaScript or asyncio.wait() with return_when=FIRST_COMPLETED
and return_when=ALL_COMPLETED
respectively in Python.
In the future, I would like to simplify and improve these a bit. For zip
, it should be modified to call generator.close()
on all unfinished generators to cancel them after the first one completes. This will "cancel" them, which is useful for things like stopping motors or sound playback. zip_longest()
could be simplified to not collect and return the values yielded by the generators.
It is using the low level hub API to create new classes, like the Motor
class that have generator versions of the methods.
Along the same lines, it implements a new Timer
class that has millisecond resolution since the one from LEGO only has 1 second resolution.
There is a run_tasks()
function that acts kind of like zip_longest()
, but it takes generator functions instead of the generator returned by a generator function as arguments. This is intended for the most high-level tasks of a program. Instead of running things as fast as possible, it tries to run everything in a 10 millisecond loop. My experience has been that this time works well for most control/feedback loops. But this means timers will only have a 10 ms resolution (unless you override the default interval
).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.