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

[Bug Report] LED module's input range #447

Closed
seankim811 opened this issue Mar 11, 2022 · 2 comments
Closed

[Bug Report] LED module's input range #447

seankim811 opened this issue Mar 11, 2022 · 2 comments
Labels

Comments

@seankim811
Copy link

Issue Description

While running "-t" for the tutorial, Lesson 3 throws an error from LED module's color setting.

What I Did


                     Lesson 3: Controlling modules

Now you know how to access individual modules. Let's make an object named
"button" as well for your button module. You know how to do it (You have the
modi object, "bundle").

button = bundle.button[0]
Try again!
button = bundle.buttons[0]

Perfect. With your button module and led module, we can either get data from
the module or send command to the module.

"pressed" is a property method of a button module which returns whether the
button is pressed or not (i.e. press state).
Check the press state of the button by typing button.pressed

button.pressed
False

Now, see if the same command returns True when pressing the button.

Write below code precisely.

button.pressed

button.pressed
False

Good. Now let's send a command to the led module. Led's rgb is a property or
setter method of an led module.
Let there be light by typing led.rgb = 0, 0, 255

led.rgb = 0, 0, 100
Write below code precisely.
led.rgb = 0, 0, 255

led.rgb = 0, 0, 254
Write below code precisely.
led.rgb = 0, 0, 255

led.rgb = 0, 0, 255
Traceback (most recent call last):
File "D:\Anaconda\envs\pymodi\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "D:\Anaconda\envs\pymodi\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\Sean Kim\AppData\Roaming\Python\Python36\site-packages\modi_main
.py", line 89, in
pymodi_tutor.run_introduction()
File "C:\Users\Sean Kim\AppData\Roaming\Python\Python36\site-packages\modi\util\tutorial_util.py", line 113, in run_introduction
run_selected_lesson()
File "C:\Users\Sean Kim\AppData\Roaming\Python\Python36\site-packages\modi\util\tutorial_util.py", line 213, in run_lesson2
self.run_lesson3()
File "C:\Users\Sean Kim\AppData\Roaming\Python\Python36\site-packages\modi\util\tutorial_util.py", line 273, in run_lesson3
exec(response)
File "", line 1, in
File "C:\Users\Sean Kim\AppData\Roaming\Python\Python36\site-packages\modi\module\output_module\output_module.py", line 98, in set_property
raise ValueError(f"{setter.name} "
ValueError: rgb should be in range 0~100

Expected Behavior

Accept the RGB in range of 0 to 255, then show the right color

System Info

  • PyMODI version: 1.2.0
  • Python version: 3.6
  • Operating System: Windows

You can obtain the pymodi version with:

python -c "import modi"

You can obtain the Python version with:

python --version
@seankim811
Copy link
Author

As a workaround, I replaced 100 with 255 in led.py, then it works now.

@stale
Copy link

stale bot commented Apr 11, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 11, 2022
@stale stale bot closed this as completed Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant