Jump to content
Issues with Images is known, we are working on it. ×

Pybricks

Eurobricks Vassals
  • Posts

    80
  • Joined

  • Last visited

Everything posted by Pybricks

  1. We've just added examples for the Technic Liebherr Crawler Crane LR 13000 (42146) as well!
  2. > I've downloaded EV3 Home and I'll give that a try. Since you've found the original software now, you could also get one of several books about EV3, which have tons of fun activities and things to learn. I wrote the EV3 Discovery Book, but there are plenty of others too :)
  3. Yep, multiple hubs will work via broadcasting. It's already available. Examples coming soon. Somebody built a scaled up version of the Liebherr crane with at least 7 hubs, which totally works! This week we are working on stabilizing the current release (no more beta!).
  4. Enjoy, everyone! Many of you have asked for this. This has been a huge addition to the code base, and we're thrilled that we got it working on the Technic Hub eventually. And thanks to @kbalage for announcing it to the world! For details on compatible models and connection procedures, please see this documentation page. See also this Wikipedia controller overview.
  5. It receives a tuple of values even if you just send one value. To get the value out of it, just read the first value like so: my_value = received_data[0] @The_Cook, since you choose the color for the remote light yourself, you could set the hub light to the same value.
  6. When you see an issue like this, how about opening an issue at https://github.com/pybricks/support? That puts it on our roadmap for things to fix. :)
  7. That's a great design! As you have perhaps already figured out on the other thread, the `Broadcast` class is still being worked on. It should get stable pretty soon :)
  8. The best chance to get detailed help is to ask here: https://github.com/pybricks/support/issues Thank you! In order to be able to help, can you share a small program that reproduces your issue? When the program stops, what is the error message that you see?
  9. Are you using Pybricks or the official LEGO MINDSTORMS app?
  10. You'll want to delete these lines: # Read the current settings #old_kp, old_ki, old_kd, _, _ = steer.control.pid() # Set new values #steer.control.pid(kp=old_kp*4, kd=old_kd*0.4) This was a bit of a hack that was needed only in very early version I shared with @kbalage, but it is has now spread all over the internet 😁. This is now done internally. So if you do it in your script, that makes the kp gain way too high so the motor is all over the place.
  11. But that's the best part! With Pybricks, your program remains saved without having to think about it :)
  12. Thanks for sharing @Polarlicht, it's awesome! We shared it on Facebook earlier today. It's definitely a use case we hadn't thought of. Now you just need a GPS module ;) @gyenesvi, Thanks for looking through the code. That is always good. Our main focus will probably remain LEGO hubs, but we're always happy to talk to third parties about possible collaborations.
  13. That's always good too! In this case I meant that the beta app now has the support button (the heart icon in the top right).
  14. @gyenesvi, it might be possible. See https://github.com/pybricks/support/issues/262 for a high level plan. We have quite a bit of other work in the pipeline too though. If you want to support our work, that is now possible via https://beta.pybricks.com/
  15. @Celeri: Yes, that “just works” now, so you don’t need to do anything special to save the program anymore. Just run the program, and restart it with the button whenever you like.
  16. It's a standard protocol. There's a tutorial to communicate with any type of device, including a PC or a phone: https://pybricks.com/projects/tutorials/wireless/hub-to-device/pc-communication/
  17. Do you have small script to reproduce this? Ideally something that we can try with just a hub/motor and some technic elements. (I probably don't have the same Technic set as you.) We updated the beta version (https://beta.pybricks.com/) yesterday. This should fix the program crash and remote disconnect you saw earlier. Please let me know if this is still happening. Both. But we aren't currently working on such an app.
  18. You'll want to delete this line in your code. With the new updates, the firmware will do this for you, so doing it again sets the values way too high. steer.control.pid(kp=old_kp*4, kd=old_kd*0.4) If we did it, we'd have to partner with some existing third-party hardware providers. Instead, we'd provide the remote firmware to be compatible with (more than one) LEGO hubs.
  19. One problem is that most gamepads use Bluetooth classic, and the Boost/City/Technic hubs only have Bluetooth Low Energy (BLE). By contrast, the SPIKE/MINDSTORMS hubs support both. Maybe we should produce a remote that uses BLE, and connect to multiple hubs at once? @MAMZe, could you please post your issue here? https://github.com/pybricks/support/issues This sounds like a bug and we'd love to fix it for the upcoming release.
  20. Thanks for reporting this @MAMZe! We'd love to fix this before we launch the beta as the main version. To make testing simpler, would you mind sharing what happens when you run the following program? Any errors? I put colored lights in the program so you can see how far it gets. Which colors do you see? Does it make a difference if you disconnect from the Pybricks app after loading the program, and then re-starting the program with the hub button? Please use https://beta.pybricks.com/ when you try it. Thanks! from pybricks.hubs import TechnicHub from pybricks.pupdevices import Remote from pybricks.parameters import Button, Color from pybricks.tools import wait hub = TechnicHub() # Make the light red while we connect. hub.light.on(Color.RED) # Connect to the remote. my_remote = Remote() # Make the light green when we are connected. hub.light.on(Color.GREEN) while True: # For any button press, make the light magenta. # Otherwise make it yellow. if my_remote.buttons.pressed(): hub.light.on(Color.MAGENTA) else: hub.light.on(Color.YELLOW) wait(10)
  21. Don't forget to unplug all devices. The City Hub can only be updated when there is no sensor in Port A. That's a builtin bug, so there's nothing we can do about that :-)
  22. If you use the latest version via https://beta.pybricks.com/, the separate step to save your program is no longer required. Just run the program once and you're good to go!
  23. Hi @BrickTronic - compiling programs is not Pybricks-specific. It’s the same as all MicroPython boards. Pybricks “just” adds all the code to make MicroPython run on LEGO hubs. Most of our users don’t have to know all the details, but if you’re curious, you can learn more about the MPY format in the MicroPython documentation and their source code: https://docs.micropython.org/en/latest/reference/mpyfiles.html#binary-encoding-of-mpy-files
  24. We just released a new beta version a few hours ago. Just go to https://beta.pybricks.com/ . If you were already using it before, the site will update itself a few minutes after you open it. The version in the about menu should then be: v3.2.0b4 (Pybricks Beta v2.0.0-beta.6). Then you can install the latest firmware on the hub as usual. Have fun! @vascolp: No special actions are needed to save the programs. Think of it this way - Pybricks basically turns the City/Boost/Technic hub into a mini MINDSTORMS hub :)
  25. from pybricks.hubs import CityHub from pybricks.pupdevices import ColorDistanceSensor, ColorLightMatrix from pybricks.parameters import Port, Color from pybricks.tools import wait # Initialize devices. hub = CityHub() sensor = ColorDistanceSensor(Port.A) lights = ColorLightMatrix(Port.B) # We want to detect only these colors. scanned_colors = [Color.NONE, Color.BLUE, Color.RED] sensor.detectable_colors(scanned_colors) # Waits for a color. def wait_for_colors(): wait(500) while sensor.color() != Color.NONE: wait(10) while sensor.color() == Color.NONE: wait(10) return sensor.color() # Load previous data. Bytes 0 to 9 represent colors. saved_colors = bytearray(hub.system.storage(0, 9)) while True: # Dipslay the colors. lights.on([scanned_colors[c] for c in saved_colors]) try: # Get index of next empty pixel. index = bytes(saved_colors).index(bytes([0])) except ValueError: # Display full, so start over. saved_colors = bytearray(9) index = 0 # Wait for the next color and store it. saved_colors[index] = scanned_colors.index(wait_for_colors()) hub.system.storage(0, write=bytes(saved_colors))
×
×
  • Create New...