Skip to content

Move Hub: Built-in button changes built-in led color. #1256

Closed Answered by BertLindeman
oneauraaaaa asked this question in Q&A
Discussion options

You must be logged in to vote

Hello,

Maybe some more info might help?

What firmware do you use?

To reproduce
You already decribed that.

Expected behavior
What did you expect to happen instead?

Next to these remarks I ran this code on my move hub:

from pybricks.hubs import MoveHub
from pybricks.parameters import Color, Button
from pybricks.tools import wait, StopWatch
from pybricks import version
print(version)
wait(2000)

hub = MoveHub()
value = 1

hub.system.set_stop_button(None)
hub.system.set_stop_button(None)
hub.system.set_stop_button(None)
hub.system.set_stop_button(None)

watch = StopWatch()
while watch.time() < 5000:

    if hub.button.pressed():
        hub.light.on(Color.GREEN)
        value = (value % 3) + 1

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by oneauraaaaa
Comment options

You must be logged in to vote
4 replies
@BertLindeman
Comment options

@oneauraaaaa
Comment options

@BertLindeman
Comment options

@oneauraaaaa
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants