Files
2021-04-20 17:32:17 +08:00

4.8 KiB
Raw Permalink Blame History

Contents
Watch Dog Timer RGB Bar Speaker IMU POWER

Watch Dog Timer

Feature introduction

Start the Watch Dog timer and configure the timeout period (ms). The program needs to perform Feed at regular intervals (the timer time will be refreshed and re-timed each time), otherwise the device will restart. Normal operation and reset.

  • Init WDT timeout Initialize Watch Dog and configure the timeout period (ms)

  • WDT feed Each time it is executed, the Watch Dog timer time will be refreshed

Usage

Start the Watch Dog timer and configure the timeout period. During the execution of the program, perform the Feed

RGB

Feature introduction

Driving RGB bar to turn on or off and controlling the color of light shining out to change different colors.

  • Set Rgb Bar color Set all the LEDs on both sides to a specific color

  • Set left side Rgb Bar color Set only the LEDs on the left bar to a specific color(using the drop down list we can change this to right)

  • Set the 1st Rgb colr Set the 1st or other selected LED in the LED bar to a specific color

  • Set Rgb brightness Set the brightness of the LED bar

Usage

The LED bar could be used as a meter for the input level of the microphone or to visualise the intensity of a sensor

Speaker

Feature introduction

The M5Stacks speaker can be controlled by the speaker blocks to produce sound of varying frequency, duration and volume

  • Speaker.beep Output a sound of a set frequency and duration

  • Speaker.volume Control the speaker volume

  • play.tone Play a specific musical note for a set duration of beats

Attention

The average human can only hear frequencies within the 20Hz~20KHz rangetherefore frequencies set outside of this range will not be audible

Usage

The Speaker can be used to output melodies or sounds for notification purposes

IMU

Feature introduction

The IMU Blocks get data from the M5GOs accelerometer and magnetometer.The blocks are set to recieve force data in the XY and Z directions. These blocks can also sense what orientation the M5 device is in and its acceleration.

  • Get X Get data from x axis

  • Get Y Get data from y axis

  • Get X ACC Get accleration data from x axis

  • Get Y ACC Get accleration data from y axis

  • Get Z ACC Get accleration data from z axis

  • Get X Gyr Get the Angular velocity from x axis

  • Get Y Gyr Get the Angular velocity from y axis

  • Get Z Gyr Get the Angular velocity from z axis

Usage

Use labels to show IMU data or data can also be used to do computing or logic judging.

POWER (M5Stack)

Feature introduction

Set device charging or get battery level.

  • isCharging Return whether it is charging

  • isChargeFull Return whether full battery

  • setCharge Set charging

  • get Battery Level Return battery level

Usage

If its chargingRGB turns RED. Otherwise it will be BLACK

POWER (M5StickC)

Feature introduction

Set axp192 related parameters.

  • Get charge state Return to charging state

  • Get battery voltage Return battery voltage

  • Get battery current Return battery current

  • Get Vin voltage Return VIN input voltage

  • Get Vin current Return VIN input current

  • Get VBus voltage Return VBUS voltage

  • Get VBus current Return VBUS current

  • Get AXP192 temperature Return AXP temperature

  • Power off Shutdown

  • Set battery charge current to Set charging current

  • Set LCD voltage to Set screen voltage

USAGE

Display the battery voltage and charging current, and shut down after full charge