Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable set builtin type on hubs with enough flash memory. #402

Closed
AntoniLuongPham opened this issue Jul 23, 2021 · 7 comments
Closed

Enable set builtin type on hubs with enough flash memory. #402

AntoniLuongPham opened this issue Jul 23, 2021 · 7 comments
Labels
enhancement New feature or request hub: primehub/inventorhub Issues related to the LEGO SPIKE Prime hub and LEGO MINDSTORMS Robot Invetor hub software: pybricks-micropython Issues with Pybricks MicroPython firmware (or EV3 runtime) topic: MicroPython Issues related to the MicroPython programming language

Comments

@AntoniLuongPham
Copy link

Dear @dlech and @laurensvalk,

I am trying to use the DriveBase code with the PrimeHub but it doesn't work.

Could you let me know if it works with only EV3 for now?

Thank you very much.

Antoni

@AntoniLuongPham AntoniLuongPham added support Request for technical support for a problem that is not a bug or feature request triage Issues that have not been triaged yet labels Jul 23, 2021
@dlech
Copy link
Member

dlech commented Jul 23, 2021

It should work. What is the problem? Is there an error message?

@dlech dlech added hub: primehub/inventorhub Issues related to the LEGO SPIKE Prime hub and LEGO MINDSTORMS Robot Invetor hub topic: motors Issues involving motors and removed triage Issues that have not been triaged yet labels Jul 23, 2021
@laurensvalk
Copy link
Member

We could probably add an example that sets the direction correctly.

@AntoniLuongPham AntoniLuongPham changed the title [Question] Does robotics.DriveBase work with PrimeHub/InventorHub? Pybricks on PrimeHub/InventorHub: error when using sets: NameError: name 'set' isn't defined Aug 9, 2021
@TheVinhLuong102
Copy link
Sponsor

David, Laurens,

I've looked further at the error that @AntoniLuongPham encountered the other day, and it actually didn't have to do with the DriveBase. Rather, he was using sets and got a NameError: name 'set' isn't defined on the PrimeHub.

I've asked him to change the title of this issue accordingly.

Thank you.

Vinh

@laurensvalk
Copy link
Member

Since we are using dual boot on these hubs, space is limited. It's not quite as bad as the restrictions on Move Hub, but we still have to carefully consider which features we enable.

See also pybricks/pybricks-micropython#60, where we decided not to enable set, at least not for now.

@TheVinhLuong102
Copy link
Sponsor

TheVinhLuong102 commented Aug 9, 2021

Thanks Laurens for the clarification -- I understand the rationale.

We were trying to use set because we were initially unsure about the order of the returned collection of buttons.pressed(). After some more testing we confirmed for ourselves that buttons.pressed() returned a tuple with MINUS preceding PLUS and followed by LEFT preceding RIGHT -- and hence we were able to get the job done with just tuple comparisons.

For now, I think these technical decisions should be documented so that the users of the Pybricks 3.x versions are aware.

Vinh

@laurensvalk
Copy link
Member

That's being done in #286 😉

@TheVinhLuong102
Copy link
Sponsor

Brilliant!! -- looking forward to the formal release! :)

@dlech dlech changed the title Pybricks on PrimeHub/InventorHub: error when using sets: NameError: name 'set' isn't defined Enable set builtin type on hubs with enough flash memory. Jul 18, 2022
@dlech dlech added enhancement New feature or request software: pybricks-micropython Issues with Pybricks MicroPython firmware (or EV3 runtime) topic: MicroPython Issues related to the MicroPython programming language and removed support Request for technical support for a problem that is not a bug or feature request topic: motors Issues involving motors labels Jul 18, 2022
dlech added a commit to pybricks/pybricks-api that referenced this issue May 19, 2023
Add type stubs and docs for builtin `set` type.

Issue: pybricks/support#402
laurensvalk pushed a commit to pybricks/pybricks-api that referenced this issue Oct 26, 2023
Add type stubs and docs for builtin `set` type.

Issue: pybricks/support#402
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hub: primehub/inventorhub Issues related to the LEGO SPIKE Prime hub and LEGO MINDSTORMS Robot Invetor hub software: pybricks-micropython Issues with Pybricks MicroPython firmware (or EV3 runtime) topic: MicroPython Issues related to the MicroPython programming language
Projects
None yet
Development

No branches or pull requests

4 participants