pycom.heartbeat
-
Unsure if it is a bug or a choice but as fare as I can see it is only possible to use the heartbeat function with the color blue?
I could see applications where it would be nice to be able to change the heartbeat color.
-
firmware blinking blue indicate that all is ok
firmware state red indicate problem..
than changing "defaults" firmware colors are not avaiable
-
@livius I get that. I can turn the light on with a color without problem. My suggestion was that it was made possible to change the color of the heartbeat function (ie. the blinking light/firmware blinking). That way I wouldn't have to write a function for blinking lights but could use the one already in the firmware.
-
pycom.heartbeat(True)turn on fimware blinking - do not use it if you do not need default firmware state indicator only own one
on start do
pycom.heartbeat(False)and after this you can turn color by typing
pycom.rgbled(0x007f00)
-
@livius Just ran this code via the REPL:
>>> pycom.heartbeat(True) >>> pycom.rgbled(0x007f00) Traceback (most recent call last): File "<stdin>", line 1, in <module> OSError: the requested operation is not possibleAs fare as I can see I have the latest firmware version.
-
@Lokefar said in pycom.heartbeat:
pycom.heartbeat(False)
it work for me
pycom.rgbled(0x007f00) # greeni have many state indicator in rgb led color like pink, orange ..
And it work for me - do you heve latest firmware?did you do first disabling firmware blinking as mentioned in the first post?
pycom.heartbeat(False)
-
@livius I am not sure I understand your answer? I know it is possible to change the color of the LED with the
pycom.rgbled('color')command, but as you can see in the traffic light example that is with
pycom.heartbeat(False)My question/comment was that the heartbeat don't seem to work with other colors than blue.
-
@Lokefar
look here
https://docs.pycom.io/pycom_esp32/pycom_esp32/tutorial/includes/led.html?highlight=rgbthis line
disable default firmware programmed blinkingpycom.heartbeat(False)