Skip to content

Commit

Permalink
Merge pull request #15 from armel/feature_update
Browse files Browse the repository at this point in the history
Feature update
  • Loading branch information
armel authored Aug 5, 2024
2 parents 8956864 + 7cbdcf7 commit 6f2095d
Show file tree
Hide file tree
Showing 11 changed files with 1,147 additions and 1,643 deletions.
38 changes: 18 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,30 @@ First, edit `platformio.ini` file and change `default_envs` target :

You can compile the source code and flash your M5Stack.

# Config

## I2C Port
By default Unit CO2 ([SCD40](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/unit/co2/SCD40.pdf)) use PORT A of your M5Stack. But you can use PORT C (the blue one) if you're using an M5GO2 module for M5Stack Core2 or an M5GO3 for CoreS3. Take a look at file `M5AirQuality.h`, line 22 to change I2C,

- `#define I2C I2C_PORT_A` if you want to use PORT A,
- `#define I2C I2C_PORT_C_M5GO2` if you want to use PORT C (the blue one) on M5GO2 for Core2,
- `#define I2C I2C_PORT_C_M5GO3` if you want to use PORT C (the blue one) on M5GO3 for CoreS3.

## Temperature Unit
You can change the temperature unit. Take a look at file `M5AirQuality.h`, line 23 to change UNIT,
# Usage

- `#define UNIT CELCIUS` if you want to use degrees CELCIUS,
- `#define UNIT FAHRENHEIT` if you want to use degrees FAHRENHEIT.
Connect Unit CO2 to port A (I2C).

## LED Alert
If you're using an M5GO, M5GO2 or M5GO3 module, you can set a CO2 alert level that will light up in red, the module's LEDs to alert you. Take a look at file `M5AirQuality.h`, line 24 to change LED,
Use middle button to enter the settings menu. Use the right and left buttons to select a menu option and confirm with the middle button. If necessary, use the right and left buttons again to select the sub-options and the middle button to confirm.

- `#define LED 1200` if you want to set CO2 alert to 1200ppm (red if > 1200ppm),
- `#define LED 0` if you want to use de default animation (green < 1000ppm, yellow < 2000ppm, orange < 3000ppm or red).
The following options are available :

# Usage
| Settings | Value |
| -------------------- |:------------------------------------------------------------:|
| Temperature Unit | Set Temperature Unit (Celcius or Fahrenheit) |
| Led Alert | Set CO2 PPM Level (0 ~ 5000) |
| Brightness | Set Brightness (0 ~ 100%) |
| Sensor Port | Set Sensor Port (PORT A, PORT C for M5GO2, PORT C for M5GO3) |
| Beep | Set Beep (0 ~ 100%) |
| Shutdown | Shutdown your M5Stack (even if in charge) |
| Reboot | Rebbot your M5Stack (even if in charge) |
| Exit | Menu Exit |

Connect Unit CO2 to port A (I2C).
> [!NOTE]
> About Led Alert, set CO2 PPM to 0 if you want to use de default animation (green < 1000ppm, yellow < 2000ppm, orange < 3000ppm or red).
Use left and right buttons to adjust brightness.
> [!NOTE]
> Temperature Unit, Led Alert, Brightness, Sensor Port and Beep are preserved at the next restart.
# Credits

Expand Down
Binary file modified firmwares/ESP32-S3/M5AirQuality.bin
Binary file not shown.
Binary file modified firmwares/ESP32/M5AirQuality.bin
Binary file not shown.
6 changes: 3 additions & 3 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ lib_deps =
fastled/FastLED@3.5.0

[env:core]
build_flags = ${env.build_flags} -DBOARD=1 -DBRIGHTNESS=32 -DWIDTH=320 -DHEIGHT=240
build_flags = ${env.build_flags} -DBOARD=1 -DWIDTH=320 -DHEIGHT=240

board_build.mcu = esp32
board_build.flash_mode = qio
Expand All @@ -43,7 +43,7 @@ board_build.partitions = default_16MB.csv
;upload_port = /dev/cu.wchusbserial53230020071

[env:core2]
build_flags = ${env.build_flags} -DBOARD=2 -DBRIGHTNESS=32 -DWIDTH=320 -DHEIGHT=240
build_flags = ${env.build_flags} -DBOARD=2 -DWIDTH=320 -DHEIGHT=240

board_build.mcu = esp32
board_build.flash_mode = qio
Expand All @@ -57,7 +57,7 @@ board_build.partitions = default_16MB.csv
;upload_port = /dev/cu.wchusbserial53230020071

[env:cores3]
build_flags = ${env.build_flags} -DBOARD=3 -DBRIGHTNESS=64 -DWIDTH=320 -DHEIGHT=240
build_flags = ${env.build_flags} -DBOARD=3 -DWIDTH=320 -DHEIGHT=240

board_build.arduino.memory_type = qio_qspi
board_build.flash_mode = qio
Expand Down
Loading

0 comments on commit 6f2095d

Please sign in to comment.