Skip to content

Instantly share code, notes, and snippets.

@abmantis
Created July 4, 2023 21:06
Show Gist options
  • Save abmantis/7ccca3ea1793226058cd975f75ad7d58 to your computer and use it in GitHub Desktop.
Save abmantis/7ccca3ea1793226058cd975f75ad7d58 to your computer and use it in GitHub Desktop.
M5Stack Atom Matrix ESPHome
esphome:
name: m5-atom-matrix
platformio_options:
upload_speed: 115200
on_boot:
priority: 700
then:
- output.turn_on: wifi_fix_output
esp32:
board: m5stack-atom
logger:
api:
encryption:
key: !secret 'apiencryptionkey'
ota:
password: !secret 'apipass'
wifi:
networks:
- ssid: !secret 'ssid'
password: !secret 'wifipass'
output:
# Countermeasure to the problem that CH552 applies 4v to GPIO0, thus reducing WiFi sensitivity.
# Setting output_high adds a bias of 3.3v and suppresses overvoltage.
# From: https://github.com/m5stack/M5Unified/blob/d26d2415f409b664631ff066ceeaffd6a753a4ff/src/M5Unified.cpp#L506
- platform: gpio
id: wifi_fix_output
pin: GPIO0
i2c:
sda: 25
scl: 21
#scan: true
#frequency: 200kHz
binary_sensor:
- platform: gpio
id: btn1
pin:
number: 39
inverted: true
on_click:
then:
- if:
condition:
- light.is_on: matrix_light
then:
- light.turn_off: matrix_light
else:
- light.turn_on:
id: matrix_light
effect: rainbow
light:
- platform: fastled_clockless # 5x5 RGB Matrix (WS2812C)
name: "5x5 Matrix"
id: matrix_light
pin: 27
chipset: WS2812
num_leds: 25
color_correct: [50%, 50%, 50%] # The LED's on the Atom Matrix should not be run at full power
effects:
- addressable_rainbow:
name: rainbow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment