Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal LED control #149

Open
oskarirauta opened this issue Apr 21, 2018 · 3 comments
Open

Internal LED control #149

oskarirauta opened this issue Apr 21, 2018 · 3 comments

Comments

@oskarirauta
Copy link
Contributor

oskarirauta commented Apr 21, 2018

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).

led.mode(LED.manual) -- stop blinking (and turn it off)
led.state(LED.on) -- turn it on if manual mode is enabled
led.state(LED.off) -- turn it off
led.mode(LED.automatic) -- resume normal operation mode (start blinking)
@jolivepetrus
Copy link
Contributor

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.

@oskarirauta
Copy link
Contributor Author

oskarirauta commented Apr 22, 2018 via email

@the0ne
Copy link
Collaborator

the0ne commented Jul 26, 2019

@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:

ESP32-LED
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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants