Skip to content

Commit

Permalink
Add HatADC,ADC11,DAC2 and Fixes differentialVoltage
Browse files Browse the repository at this point in the history
  • Loading branch information
GOB52 committed Mar 4, 2025
1 parent 4956880 commit 73bca74
Show file tree
Hide file tree
Showing 24 changed files with 1,928 additions and 835 deletions.
34 changes: 21 additions & 13 deletions .github/workflows/arduino-esp-v2-build-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,16 @@ jobs:
- https://espressif.github.io/arduino-esp32/package_esp32_index.json

sketch:
- PlotToSerial
- Output
- ADCInput
- DACOutput

unit:
- UnitADC
- UnitDAC
- UnitDAC2
# unit:
# - UnitADC11
# - UnitDAC
# - UnitDAC2
# - HatADC
# - HatADC11
# - HatDAC2

board:
- m5stack-atom
Expand All @@ -84,13 +87,18 @@ jobs:
archi:
- esp32

build-properties:
- "-DUSING_UNIT_ADC11"
- "-DUSING_UNIT_DAC"
- "-DUSING_UNIT_DAC2"

exclude:
- sketch: Output
unit: UnitADC
- sketch: PlotToSerial
unit: UnitDAC
- sketch: PlotToSerial
unit: UnitDAC2
- sketch: ADCInput
build-properties: "-DUSING_UNIT_DAC"
- sketch: ADCInput
build-properties: "-DUSING_UNIT_DAC2"
- sketch: DACOutput
build-properties: "-DUSING_UNIT_ADC11"

steps:
- name: Checkout
Expand All @@ -107,7 +115,7 @@ jobs:
platform-url: ${{ matrix.platform-url }}
required-libraries: ${{ env.REQUIRED_LIBRARIES }}
extra-arduino-cli-args: ${{ matrix.cli-args }}
#build-properties: ${{ toJson(matrix.build-properties) }}
build-properties: ${{ matrix.build-properties }}
sketch-names: ${{ matrix.sketch }}.ino
sketch-names-find-start: ${{ env.SKETCH_NAMES_FIND_START }}/${{ matrix.unit }}
#sketches-exclude: ${{ matrix.sketches-exclude }}
82 changes: 68 additions & 14 deletions .github/workflows/arduino-esp-v3-build-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,16 @@ jobs:
- https://espressif.github.io/arduino-esp32/package_esp32_index.json

sketch:
- Output
- PlotToSerial
- ADCInput
- DACOutput

unit:
- UnitADC
- UnitDAC
- UnitDAC2
# unit:
# - UnitADC11
# - UnitDAC
# - UnitDAC2
# - HatADC
# - HatADC11
# - HatDAC2

board:
- m5stack_atom
Expand Down Expand Up @@ -100,21 +103,72 @@ jobs:
# - m5stack_unit_cams3

platform-version:
- 3.0.4
- 3.1.3

platform:
- esp32

archi:
- esp32

build-properties:
- "-DUSING_UNIT_ADC11"
- "-DUSING_UNIT_DAC"
- "-DUSING_UNIT_DAC2"

exclude:
- sketch: Output
unit: UnitADC
- sketch: PlotToSerial
unit: UnitDAC
- sketch: PlotToSerial
unit: UnitDAC2
- sketch: ADCInput
build-properties: "-DUSING_UNIT_DAC"
- sketch: ADCInput
build-properties: "-DUSING_UNIT_DAC2"
- sketch: DACOutput
build-properties: "-DUSING_UNIT_ADC11"

include:
# Specific sketches
- sketch: ADCInput
platform-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json
platform-version: 3.1.3
platform: esp32
archi: esp32
board: m5stack_stickc_plus
build-properties: "-DUSING_HAT_ADC"
- sketch: ADCInput
platform-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json
platform-version: 3.1.3
platform: esp32
archi: esp32
board: m5stack_stickc_plus
build-properties: "-DUSING_HAT_ADC11"
- sketch: DACOutput
platform-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json
platform-version: 3.1.3
platform: esp32
archi: esp32
board: m5stack_stickc_plus
build-properties: "-DUSING_HAT_DAC2"
- sketch: ADCInput
platform-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json
platform-version: 3.1.3
platform: esp32
archi: esp32
board: m5stack_stickc_plus2
build-properties: "-DUSING_HAT_ADC"
- sketch: ADCInput
platform-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json
platform-version: 3.1.3
platform: esp32
archi: esp32
board: m5stack_stickc_plus2
build-properties: "-DUSING_HAT_ADC11"
- sketch: DACOutput
platform-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json
platform-version: 3.1.3
platform: esp32
archi: esp32
board: m5stack_stickc_plus2
build-properties: "-DUSING_HAT_DAC2"


steps:
- name: Checkout
Expand All @@ -131,7 +185,7 @@ jobs:
platform-url: ${{ matrix.platform-url }}
required-libraries: ${{ env.REQUIRED_LIBRARIES }}
extra-arduino-cli-args: ${{ matrix.cli-args }}
#build-properties: ${{ toJson(matrix.build-properties) }}
build-properties: ${{ matrix.build-properties }}
sketch-names: ${{ matrix.sketch }}.ino
sketch-names-find-start: ${{ env.SKETCH_NAMES_FIND_START }}/${{ matrix.unit }}
#sketches-exclude: ${{ matrix.sketches-exclude }}
74 changes: 61 additions & 13 deletions .github/workflows/arduino-m5-build-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,16 @@ jobs:
- https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json

sketch:
- Output
- PlotToSerial
- ADCInput
- DACOutput

unit:
- UnitADC
- UnitDAC
- UnitDAC2
# unit:
# - UnitADC11
# - UnitDAC
# - UnitDAC2
# - HatADC
# - HatADC11
# - HatDAC2

board:
- m5stack_atom
Expand Down Expand Up @@ -103,12 +106,57 @@ jobs:
- esp32

exclude:
- sketch: Output
unit: UnitADC
- sketch: PlotToSerial
unit: UnitDAC
- sketch: PlotToSerial
unit: UnitDAC2
- sketch: ADCInput
build-properties: "-DUSING_UNIT_DAC"
- sketch: ADCInput
build-properties: "-DUSING_UNIT_DAC2"
- sketch: DACOutput
build-properties: "-DUSING_UNIT_ADC11"

include:
# Specific sketches
- sketch: ADCInput
platform-url: https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json
platform-version: 2.1.2
platform: m5stack
archi: esp32
board: m5stack_stickc_plus
build-properties: "-DUSING_HAT_ADC"
- sketch: ADCInput
platform-url: https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json
platform-version: 2.1.2
platform: m5stack
archi: esp32
board: m5stack_stickc_plus
build-properties: "-DUSING_HAT_ADC11"
- sketch: DACOutput
platform-url: https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json
platform-version: 2.1.2
platform: m5stack
archi: esp32
board: m5stack_stickc_plus
build-properties: "-DUSING_HAT_DAC2"
- sketch: ADCInput
platform-url: https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json
platform-version: 2.1.2
platform: m5stack
archi: esp32
board: m5stack_stickc_plus2
build-properties: "-DUSING_HAT_ADC"
- sketch: ADCInput
platform-url: https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json
platform-version: 2.1.2
platform: m5stack
archi: esp32
board: m5stack_stickc_plus2
build-properties: "-DUSING_HAT_ADC11"
- sketch: DACOutput
platform-url: https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json
platform-version: 2.1.2
platform: m5stack
archi: esp32
board: m5stack_stickc_plus2
build-properties: "-DUSING_HAT_DAC2"

steps:
- name: Checkout
Expand All @@ -125,7 +173,7 @@ jobs:
platform-url: ${{ matrix.platform-url }}
required-libraries: ${{ env.REQUIRED_LIBRARIES }}
extra-arduino-cli-args: ${{ matrix.cli-args }}
#build-properties: ${{ toJson(matrix.build-properties) }}
build-properties: ${{ matrix.build-properties }}
sketch-names: ${{ matrix.sketch }}.ino
sketch-names-find-start: ${{ env.SKETCH_NAMES_FIND_START }}/${{ matrix.unit }}
#sketches-exclude: ${{ matrix.sketches-exclude }}
Expand Down
50 changes: 43 additions & 7 deletions .github/workflows/platformio-build-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,16 @@ jobs:

matrix:
example:
- Output
- PlotToSerial
- ADCInput
- DACOutput

unit:
- UnitADC
- UnitADC11
- UnitDAC
- UnitDAC2
# - HatADC
# - HatADC11
# - HatDAC2

board:
- Core
Expand Down Expand Up @@ -117,12 +120,45 @@ jobs:
# espressif32: '4_4_0'

exclude:
- example: Output
unit: UnitADC
- example: PlotToSerial
- example: ADCInput
unit: UnitDAC
- example: PlotToSerial
- example: ADCInput
unit: UnitDAC2
- example: DACOutput
unit: UnitADC11

include:
# Specific sketches
- sketch: ADCInput
framework: Arduino
espressif32: latest
unit: HatADC
board: StickCPlus
- sketch: ADCInput
framework: Arduino
espressif32: latest
unit: HatADC11
board: StickCPlus
- sketch: DACOutput
framework: Arduino
espressif32: latest
unit: HatDAC2
board: StickCPlus
- sketch: ADCInput
framework: Arduino
espressif32: latest
unit: HatADC
board: StickCPlus2
- sketch: ADCInput
framework: Arduino
espressif32: latest
unit: HatADC11
board: StickCPlus2
- sketch: DACOutput
framework: Arduino
espressif32: latest
unit: HatDAC2
board: StickCPlus2

steps:
- name: Checkout
Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,25 @@ DAC2 Unit is an I2C digital-to-analog signal conversion unit. It utilizes the GP
### SKU:U013-V11
ADC V1.1 Unit is an A/D conversion module that utilizes the ADS1110 chip, a 16-bit self-calibrating analog-to-digital converter. It is designed with an I2C interface, offering convenient connectivity. The module offers conversion speeds of 8, 16, 32, and 128 samples per second (SPS), providing varying levels of accuracy at 16, 15, 14, and 12 bits of resolution respectively.

### SKU:U068-B
DAC2 Hat is an I2C digital-to-analog signal conversion unit designed to be compatible with the StickC series controllers. It offers high precision and accuracy in its performance by using the GP8413 solution

### SKU:U069
ADC HAT is another type of C-HAT specifically design for M5StickC controller. Same as ADC unit, this is an ADC converter component for stickc. Packed with an ADC converter chip ADS1100,

### SKU:U069-V11
ADC HAT V1.1 is another type of C-HAT specifically design for M5StickC controller. Same as ADC unit, this is an ADC converter component for stickc. Packed with an ADC converter chip ADS1110,


## Related Link
See also examples using conventional methods here.

- [Unit DAC & Datasheet](https://docs.m5stack.com/en/unit/dac)
- [Unit DAC2 & Datasheet](https://docs.m5stack.com/en/unit/Unit-DAC2)
- [Unit ADC v1.1 & Datasheet](https://docs.m5stack.com/en/unit/Unit-ADC_V1.1)

- [Hat DAC2 & Datasheet](https://docs.m5stack.com/en/hat/Hat-DAC2)
- [Hat ADC & Datasheet](https://docs.m5stack.com/en/hat/hat-adc)
- [Hat ADC v1.1 & Datasheet](https://docs.m5stack.com/en/hat/HAT-ADC-V11)

### Required Libraries:
- [M5UnitUnified](https://github.com/m5stack/M5UnitUnified)
Expand Down
21 changes: 21 additions & 0 deletions examples/UnitUnified/ADCInput/ADCInput.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* SPDX-FileCopyrightText: 2025 M5Stack Technology CO LTD
*
* SPDX-License-Identifier: MIT
*/
/*
Example using M5UnitUnified for UnitADC11/HatADC11/HatADC
*/
// *************************************************************
// Choose one define symbol to match the unit you are using
// *************************************************************
#if !defined(USING_UNIT_ADC11) && !defined(USING_HAT_ADC11) && !defined(USING_HAT_ADC)
// For UnitADC11
// #define USING_UNIT_ADC11
// For HatADC11
// #define USING_HAT_ADC11
// For HatADC
// #define USING_HAT_ADC
#endif
// *************************************************************
#include "main/ADCInput.cpp"
Loading

0 comments on commit 73bca74

Please sign in to comment.