Open oskarirauta opened 6 years ago
Hi @oskarirauta,
Something about your request is done in the mesh feature that we will add to Lua RTOS soon. There will be a new Lua function in the os module to control the activity led.
Sounds good :)
On 22 Apr 2018, at 23.51, Jaume Olivé Petrus notifications@github.com wrote:
Hi @oskarirauta https://github.com/oskarirauta,
Something about your request is done in the mesh feature that we will add to Lua RTOS soon. There will be a new Lua function in the os module to control the activity led.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/whitecatboard/Lua-RTOS-ESP32/issues/149#issuecomment-383411390, or mute the thread https://github.com/notifications/unsubscribe-auth/ABRSHi9NoV7Z3ZUkoLM_BqjMpUUhY2lrks5trO1JgaJpZM4TeqjS.
@oskarirauta as you can see the LED you mention is not built into the esp32 chip itself but into the board that the esp32 is mounted on:
So - depending on which PIO the board designer connected the LED to - controlling the LED is as easy as:
-- this depends on the board
led_pin = pio.GPIO2
-- enable controlling the LED
pio.pin.setdir(pio.OUTPUT, led_pin)
-- enable the on-board LED
pio.pin.sethigh(led_pin)
-- disable the on-board LED
pio.pin.setlow(led_pin)
@jolivepetrus do you want to keep this open?
I think we should be able to control internal LED (if set) - or at least, stop blinking. Currently this can be achieved by setting it's GPIO state to input, but I think there could be a better way as well.
How about a minimal module for this? led state module for selecting mode from manual or automatic (blinking).