Skip to content
Permalink
Browse files

Merge pull request #53 from brentru/expose-rgbled-status-wifimanager

Add RGB Status LED to WiFiManager
  • Loading branch information...
ladyada committed Jun 11, 2019
2 parents 46b4dea + aeae91e commit 92182ea352b1f0ca54a323ecc880004067e2234d
Showing with 16 additions and 5 deletions.
  1. +8 −4 adafruit_esp32spi/adafruit_esp32spi_wifimanager.py
  2. +8 −1 examples/esp32spi_aio_post.py
@@ -42,8 +42,9 @@ def __init__(self, esp, secrets, status_pixel=None, attempts=2):
"""
:param ESP_SPIcontrol esp: The ESP object we are using
:param dict secrets: The WiFi and Adafruit IO secrets dict (See examples)
:param status_pixel: (Optional) The pixel device - A NeoPixel or DotStar (default=None)
:type status_pixel: NeoPixel or DotStar
:param status_pixel: (Optional) The pixel device - A NeoPixel, DotStar,
or RGB LED (default=None)
:type status_pixel: NeoPixel, DotStar, or RGB LED
:param int attempts: (Optional) Failed attempts before resetting the ESP32 (default=2)
"""
# Read the settings
@@ -214,13 +215,16 @@ def ip_address(self):

def pixel_status(self, value):
"""
Change Status NeoPixel if it was defined
Change Status Pixel if it was defined
:param value: The value to set the Board's status LED to
:type value: int or 3-value tuple
"""
if self.statuspix:
self.statuspix.fill(value)
if hasattr(self.statuspix, 'color'):
self.statuspix.color = value
else:
self.statuspix.fill(value)

def signal_strength(self):
"""
@@ -30,7 +30,14 @@
"""Use below for Most Boards"""
status_light = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=0.2) # Uncomment for Most Boards
"""Uncomment below for ItsyBitsy M4"""
#status_light = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=0.2)
# status_light = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=0.2)
# Uncomment below for an externally defined RGB LED
# import adafruit_rgbled
# from adafruit_esp32spi import PWMOut
# RED_LED = PWMOut.PWMOut(esp, 26)
# GREEN_LED = PWMOut.PWMOut(esp, 27)
# BLUE_LED = PWMOut.PWMOut(esp, 25)
# status_light = adafruit_rgbled.RGBLED(RED_LED, BLUE_LED, GREEN_LED)
wifi = adafruit_esp32spi_wifimanager.ESPSPI_WiFiManager(esp, secrets, status_light)

counter = 0

0 comments on commit 92182ea

Please sign in to comment.
You can’t perform that action at this time.