From bf415d05cc1aece93ff813652f4992d9110942c6 Mon Sep 17 00:00:00 2001 From: paulchilton Date: Mon, 2 Jan 2023 09:00:40 +0000 Subject: [PATCH] Added README details specific to this repo --- README.md | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 52834ed..33fb139 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,24 @@ # ESPHome AXP192 Component -This custom component it to implement support for the AXP192 for both the M5Stick-C, and the M5Stack Core2, building on top of airy10's code. +Built on top of martydingo's version of the axp192 power management IC library for ESPHome, I have added support for the M5Tough, which requires a different register configuration for the M5Tough ILI9342C display. Other changes include a fix to stop the log being spammed with brightness values continually, these are only logged on change. Also the M5Tough needs resetting once the axp192 registers are set for the display to properly initialise so this version sets up the axp and then resets the ESP32 automatically. ## Installation -Copy the components to a custom_components directory next to your .yaml configuration file. +Copy the components to a custom_components directory next to your .yaml configuration file, or include directly from this repository. ## Configuration -Sample configurations can be found within `/sample-config`. Please note that I've not yet been able to correctly configure the M5Stick-C screen just yet, however the AXP192 component does initalise it, and the sample configuration currently demostrates a white screen, when it should present some text. I plan to fix this soon. +Sample configurations are found in the `/sample-config` folder. -This component adds a new model configuration to the AXP192 sensor, `model: M5CORE2` & `model: M5STICKC`, as so the right pins are initalized and voltages go to the right places: +This component adds a new model configuration to the AXP192 sensor which determines which registers are needed for each device. Available models are `model: M5CORE2`, `model: M5STICKC` and `model: M5TOUGH`. + +### Include axp192 component + +```yaml +external_components: + - source: github://paulchilton/esphome-axp192 + components: [axp192] +``` ### M5Stick-C @@ -40,7 +48,6 @@ sensor: id: "${devicename}_batterylevel" ``` - ### M5Tough ```yaml @@ -54,3 +61,16 @@ sensor: name: "${upper_devicename} Battery Level" id: "${devicename}_batterylevel" ``` + +The display component required for the M5Tough is as follows: + +```yaml +display: + - platform: ili9341 + # 320x240 + model: M5STACK + cs_pin: GPIO5 + dc_pin: GPIO15 + lambda: |- + it.print(160, 0, id(title_font), id(color_white), TextAlign::TOP_CENTER, "Hello World"); +```