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

Iodevices example #133

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

hwillemen
Copy link
Contributor

A related but more advanced diagnostics script.

hwillemen and others added 4 commits February 23, 2023 16:29
Added:
- non-uart DCMotors  (Medium and Train)
- non-uart Light
- SPIKE 3x3 Color Matrix
- SPIKE Small Angular Motor
see pupdevice.rst for description.
A lot of dynamic features for more advanced programming
pulling in changes from port_info.py
@hwillemen
Copy link
Contributor Author

I will look at the failed linter tomorrow.

@laurensvalk
Copy link
Member

Thanks for the submission. For larger scripts like these, it may be better to submit it to the pybricks-projects repository. Feel free to post it as an issue there first, so we can help you find a good location for it.

Fixed the first batch of lint errors
@hwillemen
Copy link
Contributor Author

My thinking was that this script is a more extended version of the iodevices example.
Since it is not related to an actual project I thought the projects repo would be less suitable.
If you do not agree with that and still thinks it should go under projects let me know.
But let me use/abuse this branch to fix a the linting errors. so a few more commits coming.

from pybricks.pupdevices import * is not allowed?
Would "import pybricks.pupdevices as pupdev" be better?
I do not want to type a very long list there.

changed the "from pybricks.pupdevices import *" to the full list.
put port list creation in GetPorts().
cleaned up ConnectToDevice() and collapsed similar code.
fixed some remaining linter errors.
fixed small bugs regarding DIAGNOSTICS_PERIOD and DCMotor.
added IMU to the diagnostics.

satisfy linter
@hwillemen hwillemen force-pushed the iodevices-example branch from 4723f33 to 39d38d2 Compare March 9, 2023 14:53
@hwillemen hwillemen force-pushed the iodevices-example branch from 55fbd0c to 8133c71 Compare March 9, 2023 15:25
@hwillemen
Copy link
Contributor Author

The linting errors are fixed now and I have taken another look at pybricks-projects.
Since this is a very generic diagnostics script, it does not seem to fit in any of those categories;
it is not a project related to any set.
Also not really a tutorial.
And I think it also does not fit in the remix category.

Since it is built upon the iodevices module I think it fits best in the api.

I do agree it is a large script though, but I am not sure if scrolling is a problem for users.

If it is, a scroll box with copy button as for projects scripts:
https://pybricks.com/projects/sets/city/60198-cargo-train/slope-detection/#program
might be an option.
I do not know how to do that in rst though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants