Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    OSerror with rgbled

    Scheduled Pinned Locked Moved Comments & Feedback
    oserrorrgbledlopypymakr
    3 Posts 3 Posters 512 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      johnmcdnz
      last edited by

      setup:
      Pycom Lopy1
      f/w: 1.18.2
      atom+pymakr

      I have a main.py of:

      main.py -- put your code here!

      import time

      time.sleep(2)

      print('main MAC1')

      import pycom
      print('LED test')
      print (0xffffff)
      pycom.rgbled(0x0)

      Using atom I can run this file from the Run command, but it fails when synced with an OSError. It is also ok entering the code at the command line. The error is occurring on the rgbled code. If I # comment the line the following code does not error.

      This is the complete trace from run or press of the lopy reset button:

      ets Jun 8 2016 00:22:57

      rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
      ets Jun 8 2016 00:22:57

      rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
      configsip: 0, SPIWP:0xee
      clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
      mode:DIO, clock div:1
      load:0x3fff8028,len:8
      load:0x3fff8030,len:1688
      load:0x4009fa00,len:0
      load:0x4009fa00,len:14592
      entry 0x400a059c
      main MAC1
      LED test
      16777215
      Traceback (most recent call last):
      File "main.py", line 12, in <module>
      OSError: the requested operation is not possible
      Pycom MicroPython 1.18.2 [v1.8.6-849-07a52e4] on 2019-02-08; LoPy with ESP32
      Type "help()" for more information.

      Note, this sample is from a larger code sample and I've taken back to the minimum lines that create the error.
      I've reflashed the lopy successfully to latest code.

      Any ideas?

      T 1 Reply Last reply Reply Quote 0
      • T Offline
        timh @johnmcdnz
        last edited by

        @johnmcdnz you need to explicitly turn the heartbeat off before you can set a colour on the LED.

        1 Reply Last reply Reply Quote 1
        • S Offline
          sarthak04
          last edited by

          import time

          time.sleep(2)
          import pycom

          pycom.heartbeat(False)

          print('main MAC1')

          print('LED test')
          print (0xffffff)
          pycom.rgbled(0x0)

          Try this code. This should run perfectly fine.

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • 1 / 1
          • First post
            Last post

          Pycom on Twitter

          Pycom