Skip to content

blink_onboard_led.py example code has errors #97

@mcp2319

Description

@mcp2319

Describe the bug

The example code in "blink_onboard_led.py" has errors and does not run.
(Bug #1) line 4 "from pico" needs to be changed to "from picozero".
(Bug #2) line 11 calls funtion "led.blink_stop() which does not seem to be defined in the library. Changing this line to "led.blink(0)" is how I fixed it. Hope this help. I love this library for the pico and RP. Thank you for making it!

01 # Blink the onboard LED, sleep for 10 seconds then stop the blinking
02 
03 from time import sleep
04 from pico import Button, LED
05 
06 led = LED()
07
08 led.blink(0.5)
09 print("Blinking")
10 sleep(10)
11 led.blink_stop()
12 print("Stopped blinking")

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions