Skip to content

micropython support for LED animations - #634

Merged
dwalton76 merged 2 commits into
ev3dev:ev3dev-stretchfrom
dwalton76:micropython-leds
May 14, 2019
Merged

dwalton76 merged 2 commits into
ev3dev:ev3dev-stretchfrom
dwalton76:micropython-leds

Conversation

@dwalton76

Copy link
Copy Markdown
Collaborator

For #633

Tested python3 and micropython via

from ev3dev2.led import Led, Leds
from time import sleep
import logging
import sys

# logging
logging.basicConfig(level=logging.DEBUG,
                    format="%(asctime)s %(levelname)5s: %(message)s")
log = logging.getLogger(__name__)

my_leds = Leds()

for x in range(4):
    if x == 0:
        my_leds.animate_police_lights('RED', 'GREEN')
    elif x == 1:
        my_leds.animate_flash('AMBER')
    elif x == 2:
        my_leds.animate_cycle(('RED', 'GREEN', 'AMBER'))
    elif x == 3:
        my_leds.animate_rainbow()

my_leds.reset()

Comment thread ev3dev2/stopwatch.py Resolved
Comment thread ev3dev2/stopwatch.py Resolved

@WasabiFan WasabiFan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks for figuring these things out!

@dwalton76
dwalton76 merged commit 56dc7ca into ev3dev:ev3dev-stretch May 14, 2019
@dwalton76
dwalton76 deleted the micropython-leds branch May 14, 2019 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants