• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

deep sleep in raspberry pico

Q&A Forum › Category: Raspberry Pi › deep sleep in raspberry pico
0 Vote Up Vote Down
Luiz Sampaio asked 11 months ago

In the book on Raspberry Pico with micropyhton there is no mention to deep sleep. Can you suggest anything? I have found not much in the web on this. Thanks, Luiz

Question Tags: Deep sleep
2 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 11 months ago

Hi.
We decided to not include deep sleep in the eBook, because at the time, many people were complaining that it didn’t work.

There’s this piece of information at the documentation if you want to try it:
https://docs.micropython.org/en/v1.16/rp2/quickref.html#deep-sleep-mode

I didn’t have the opportunity to test it yet.

 

If you test it, let me know your results.

Regards,
Sara

0 Vote Up Vote Down
Luiz Sampaio answered 11 months ago

It worked turning on-off the onboard led (see code below), adding the command “deepsleep(10000)”. Doing this, the code remains stopped during this time, 10 s. Measuring the current, it goes from 35 mA to 12 mA in deep sleep. But, when the wifi is on, it does not work. The current does not reduce and the time does not change.
 
from machine import Pin, deepsleep
import time
import machine
led = machine.Pin(“LED”, machine.Pin.OUT)
def blink(t):
    i=0
    while True:
        led.toggle()
        time.sleep(0.3)
        i+=1
        if i == t: break
while True:
    blink(10)
    deepsleep(10000)

 

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.