OSerror with rgbled
-
setup:
Pycom Lopy1
f/w: 1.18.2
atom+pymakrI 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:57rst: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?
-
@johnmcdnz you need to explicitly turn the heartbeat off before you can set a colour on the LED.
-
import time
time.sleep(2)
import pycompycom.heartbeat(False)
print('main MAC1')
print('LED test')
print (0xffffff)
pycom.rgbled(0x0)Try this code. This should run perfectly fine.
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