Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

lightsleep() not working properly Pi Pico WH v1.24.0 #16180

Open
@RYoder97

Description

@RYoder97

Port, board and/or hardware

Raspberry Pi Pico WH

MicroPython version

MicroPython v1.24.0 on 2024-10-25; Raspberry Pi Pico W with RP2040

Reproduction

Attempt following code, both with lightsleep() having no ms argument and one with:

importmachinefrommachineimportPin,deepsleep,lightsleepdefwake_up(pin):# Handle wake-up logic hereled.toggle()print("Button pressed, waking up!")# Configure buttonsbutton=Pin(11,Pin.IN,Pin.PULL_UP)# Example pinled=Pin(20,Pin.OUT)led.on()# Set up interruptbutton.irq(trigger=Pin.IRQ_FALLING|Pin.IRQ_RISING,handler=wake_up)# Go to sleep until a button is pressedlightsleep()

Expected behaviour

Expect LED to react to button press when asleep and execute wake_up function. LED is on by default. LED should toggle/turn off when button is pressed down, both when machine is asleep and not asleep.

Observed behaviour

USB power tester indicates that the board sleeps only whenNO MILLISECONDS ARGUMENT IS SPECIFIED.

When millisecondsARE SPECIFIED, board does not appear to sleep as power consumption does not drop according to the USB tester. The board continues to work at full power, and the LED reacts to the button.

WhenNO MILLISECONDS ARE SPECIFIED, board appears to go to sleep (reducing power from >10ma to 0-1ma. But button does not do anything to LED.

Additional Information

I have tried adding thewake argument tobutton.irq, but Micropython says that extra keyword arguments are present.

I understand sleeping may have issues on the Pico W models. I have also tried turning off WiFi/setting the pin associated with Wifi to "low". That does not seem to have any impact whatsoever, since my code never explicitly turns Wifion

https://forums.raspberrypi.com/viewtopic.php?p=2266590#p2266590

Code of Conduct

Yes, I agree

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp