mirror of
https://github.com/m5stack/m5-docs.git
synced 2026-05-20 10:23:01 -07:00
release ATOM SPK and update some info
This commit is contained in:
@@ -28,7 +28,7 @@ call function f every d milliseconds
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5Stack.h>
|
||||
#include "utility/M5Timer.h"
|
||||
|
||||
@@ -68,7 +68,7 @@ call function f once after d milliseconds
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5Stack.h>
|
||||
#include "utility/M5Timer.h"
|
||||
|
||||
@@ -108,7 +108,7 @@ call function f every d milliseconds for n times
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5Stack.h>
|
||||
#include "utility/M5Timer.h"
|
||||
|
||||
@@ -148,7 +148,7 @@ enables the specified timer
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5Stack.h>
|
||||
#include "utility/M5Timer.h"
|
||||
|
||||
@@ -187,7 +187,7 @@ returns true if the specified timer is enabled
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5Stack.h>
|
||||
#include "utility/M5Timer.h"
|
||||
|
||||
@@ -226,7 +226,7 @@ disables the specified timer
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5Stack.h>
|
||||
#include "utility/M5Timer.h"
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
**Description:Set screen voltage, adjust brightness, valid range of parameters is 2500-3300**
|
||||
|
||||
**Example:**
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5Core2.h>
|
||||
|
||||
void setup() {
|
||||
@@ -40,7 +40,7 @@ void loop() {
|
||||
**Description:Set the built-in LED light, state: 1 is on, state: 0 is off**
|
||||
|
||||
**Example:**
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5Core2.h>
|
||||
|
||||
void setup() {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
void setup() {
|
||||
@@ -31,7 +31,7 @@ void loop() {}
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
int level;
|
||||
|
||||
@@ -59,7 +59,7 @@ void loop() {
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
int count = 0;
|
||||
@@ -90,7 +90,7 @@ void loop() {
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
void setup() {
|
||||
@@ -118,7 +118,7 @@ void loop() {
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
void setup() {
|
||||
@@ -153,7 +153,7 @@ void loop() {
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
uint8_t i = 7;
|
||||
@@ -179,7 +179,7 @@ void loop() {
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
double vbat = 0.0;
|
||||
@@ -207,7 +207,7 @@ void loop() {
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
int charge;
|
||||
@@ -235,7 +235,7 @@ void loop() {
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
int bat;
|
||||
@@ -264,7 +264,7 @@ void loop() {
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
int Vaps;
|
||||
@@ -292,7 +292,7 @@ void loop() {
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
int temp;
|
||||
@@ -320,7 +320,7 @@ void loop() {
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
void setup() {
|
||||
@@ -345,7 +345,7 @@ void loop() {
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
int disCharge;
|
||||
@@ -373,7 +373,7 @@ void loop() {
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
int Iusb;
|
||||
|
||||
@@ -12,7 +12,7 @@ This function returns reading the state of the button directly. 1: pressed, 0: r
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5Stack.h>
|
||||
|
||||
void setup() {
|
||||
@@ -38,7 +38,7 @@ This function returns the state of the button the last time Button.read() was ca
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5Stack.h>
|
||||
|
||||
void setup() {
|
||||
@@ -68,7 +68,7 @@ This function returns 1 only once each time the button is pressed. 1: pressed, 0
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5Stack.h>
|
||||
|
||||
void setup() {
|
||||
@@ -98,7 +98,7 @@ releasedFor(ms) check to see if the button is pressed (or released), and has bee
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5Stack.h>
|
||||
|
||||
void setup() {
|
||||
@@ -136,7 +136,7 @@ This function returns 1 if button has been pressed for more than specified time.
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5Stack.h>
|
||||
|
||||
void setup() {
|
||||
@@ -166,7 +166,7 @@ Returns the last state time point .
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5Stack.h>
|
||||
|
||||
void setup() {
|
||||
@@ -193,7 +193,7 @@ releasedFor(ms) check to see if the button is released, and has been in that sta
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5Stack.h>
|
||||
|
||||
void setup() {
|
||||
@@ -227,7 +227,7 @@ This function returns 1 only once each time the button is pressed. 1: pressed, 0
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5Stack.h>
|
||||
|
||||
void setup() {
|
||||
|
||||
@@ -210,7 +210,7 @@ Perform device presence check on I2C bus.
|
||||
|
||||
**Example of use;**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
bool result[0x80];
|
||||
M5.I2C.scanID(&result[0]);
|
||||
```
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# RTC
|
||||
|
||||
```
|
||||
```clike
|
||||
typedef struct RTC_Time
|
||||
{
|
||||
int8_t Hours;
|
||||
@@ -64,7 +64,7 @@ Get RTC Date Struct
|
||||
|
||||
**Example:**
|
||||
|
||||
```
|
||||
```clike
|
||||
#include <M5Core2.h>
|
||||
|
||||
RTC_TimeTypeDef RTCtime;
|
||||
@@ -138,7 +138,7 @@ Turn off the power, pass in the RTC time structure specified for a certain point
|
||||
|
||||
**Example:**
|
||||
|
||||
```
|
||||
```clike
|
||||
#include <M5Core2.h>
|
||||
|
||||
RTC_TimeTypeDef RTCtime;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
?>Before using the E-Ink screen operation function, you need to create an instance and pass in the screen driver address. Call `M5.M5Ink.isInit()` and initialize with `M5.M5Ink.clear();`.
|
||||
|
||||
```
|
||||
```clike
|
||||
#include "M5CoreInk.h"
|
||||
|
||||
Ink_Sprite InkPageSprite(&M5.M5Ink);
|
||||
@@ -37,7 +37,7 @@ void setup()
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
|
||||
if( InkPageSprite.creatSprite(0,0,200,200,true) != 0 )
|
||||
{
|
||||
@@ -58,7 +58,7 @@ Serial.printf("Ink Sprite creat successful");
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
|
||||
InkPageSprite.clear();
|
||||
|
||||
@@ -75,7 +75,7 @@ InkPageSprite.clear();
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
|
||||
InkPageSprite.deleteSprite();
|
||||
|
||||
@@ -91,7 +91,7 @@ InkPageSprite.deleteSprite();
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
InkPageSprite.drawString(10,50,"Hello World!",&AsciiFont8x16);
|
||||
InkPageSprite.pushSprite();
|
||||
```
|
||||
@@ -106,7 +106,7 @@ InkPageSprite.pushSprite();
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
InkPageSprite.drawPix(100,100,0);
|
||||
InkPageSprite.pushSprite();
|
||||
```
|
||||
@@ -126,7 +126,7 @@ InkPageSprite.pushSprite();
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
InkPageSprite.FillRect(0,0,100,100,0);
|
||||
InkPageSprite.pushSprite();
|
||||
```
|
||||
@@ -159,7 +159,7 @@ InkPageSprite.pushSprite();
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
InkPageSprite.drawChar(35,50,'M');
|
||||
InkPageSprite.pushSprite();
|
||||
```
|
||||
@@ -175,7 +175,7 @@ InkPageSprite.pushSprite();
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
InkPageSprite.drawString(35,50,"Hello World!");
|
||||
InkPageSprite.pushSprite();
|
||||
```
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include "M5CoreInk.h"
|
||||
|
||||
void setup() {
|
||||
@@ -29,7 +29,7 @@ void setup() {
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
|
||||
if( M5.BtnPWR.wasPressed())
|
||||
{
|
||||
@@ -78,7 +78,7 @@ M5.update();
|
||||
`void playMusic(const uint8_t *music_data, uint16_t sample_rate);`
|
||||
|
||||
|
||||
```
|
||||
```clike
|
||||
M5.Speaker.tone(2700);
|
||||
```
|
||||
|
||||
@@ -86,7 +86,7 @@ M5.Speaker.tone(2700);
|
||||
|
||||
?> Please use `M5.begin();` to initialize RTC related functions before using
|
||||
|
||||
```
|
||||
```clike
|
||||
typedef struct RTC_Time
|
||||
{
|
||||
int8_t Hours;
|
||||
@@ -150,7 +150,7 @@ Get RTC Date Struct
|
||||
|
||||
**Example:**
|
||||
|
||||
```
|
||||
```clike
|
||||
#include "M5CoreInk.h"
|
||||
|
||||
Ink_Sprite InkPageSprite(&M5.M5Ink);
|
||||
@@ -237,7 +237,7 @@ Turn off the power, pass in the RTC time structure specified for a certain point
|
||||
|
||||
**Example:**
|
||||
|
||||
```
|
||||
```clike
|
||||
#include "M5CoreInk.h"
|
||||
void setup()
|
||||
{
|
||||
|
||||
+5
-5
@@ -72,7 +72,7 @@ Pin input state(0/1)
|
||||
|
||||
**Example of use;**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
uint32_t pin21_data;
|
||||
pin21_data = digitalRead(21);
|
||||
```
|
||||
@@ -107,7 +107,7 @@ None.
|
||||
|
||||
**Example of use;**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
digitalWrite(2,1);
|
||||
```
|
||||
|
||||
@@ -142,7 +142,7 @@ Make sure that the operations are correct as there is a risk of damage.
|
||||
|
||||
**Example of use;**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
pinMode(2,INPUT);
|
||||
```
|
||||
|
||||
@@ -171,7 +171,7 @@ G35 and G36 can be used in M5Stack.
|
||||
|
||||
**Example of use;**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
uint16_t ret;
|
||||
ret=analogRead(35);
|
||||
```
|
||||
@@ -203,7 +203,7 @@ G25 and G26 can be used in M5Stack.
|
||||
|
||||
**Example of use;**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
dacWrite(25,0x40);
|
||||
```
|
||||
|
||||
|
||||
+5
-5
@@ -11,7 +11,7 @@
|
||||
**Description:initialize IMU**
|
||||
|
||||
**Example:**
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
void setup() {
|
||||
@@ -31,7 +31,7 @@ void loop() {}
|
||||
**Description:Obtain the three-axis gyroscope data of the IMU chip.**
|
||||
|
||||
**Example:**
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
float gyroX, gyroY, gyroZ;
|
||||
@@ -57,7 +57,7 @@ void loop() {
|
||||
**Description:Obtain the three-axis accelerometer data of the IMU chip.**
|
||||
|
||||
**Example:**
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
float accX, accY, accZ;
|
||||
@@ -83,7 +83,7 @@ void loop() {
|
||||
**Description:Get the attitude of the IMU chip.**
|
||||
|
||||
**Example:**
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
float pitch, roll, yaw;
|
||||
@@ -109,7 +109,7 @@ void loop() {
|
||||
**Description:Get the temperature of the IMU chip.**
|
||||
|
||||
**Example:**
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
float temp;
|
||||
|
||||
+79
-79
File diff suppressed because it is too large
Load Diff
+13
-13
@@ -16,7 +16,7 @@
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
uint8_t i = 7;
|
||||
@@ -48,7 +48,7 @@ void loop() {
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
void setup() {
|
||||
@@ -77,7 +77,7 @@ void loop() {}
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
void setup() {
|
||||
@@ -100,7 +100,7 @@ void loop() {}
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
void setup() {
|
||||
@@ -131,7 +131,7 @@ void loop(){}
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
void setup() {
|
||||
@@ -159,7 +159,7 @@ void loop() {}
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
void setup() {
|
||||
@@ -187,7 +187,7 @@ void loop() {}
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
void setup() {
|
||||
@@ -215,7 +215,7 @@ void loop() {}
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
void setup() {
|
||||
@@ -245,7 +245,7 @@ void loop() {}
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
void setup() {
|
||||
@@ -275,7 +275,7 @@ void loop() {}
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
void setup() {
|
||||
@@ -306,7 +306,7 @@ void loop() {}
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
void setup() {
|
||||
@@ -330,7 +330,7 @@ void loop() {}
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
void setup() {
|
||||
@@ -342,7 +342,7 @@ void loop() {}
|
||||
|
||||
## Usage {docsify-ignore}
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
void setup() {
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
>The library uses the `Canvas` class for drawing patterns, which provides a variety of drawing APIs (including drawing strings, rectangles, triangles, circles, image data, etc.). To use it, you need to create a canvas instance and pass it to the screen driver, as shown in the following code.
|
||||
|
||||
```
|
||||
```clike
|
||||
#include <M5EPD.h>
|
||||
|
||||
M5EPD_Canvas canvas(&M5.EPD);
|
||||
@@ -63,7 +63,7 @@ M5EPD_Canvas canvas(&M5.EPD);
|
||||
- **Function: Deleting Canvas and Freeing Memory**
|
||||
- `void deleteCanvas(void)`
|
||||
|
||||
```
|
||||
```clike
|
||||
#include <M5EPD.h>
|
||||
|
||||
M5EPD_Canvas canvas(&M5.EPD);
|
||||
@@ -94,7 +94,7 @@ canvas.createCanvas(400, 300);
|
||||
|
||||
**Example:**
|
||||
|
||||
```
|
||||
```clike
|
||||
#include <M5EPD.h>
|
||||
|
||||
M5EPD_Canvas canvas(&M5.EPD);
|
||||
@@ -122,7 +122,7 @@ void loop()
|
||||
|
||||
>To use `pushCanvas`, we need to pass a refresh mode parameter. The library `m5epd_update_mode_t` already enumerates several different update modes.
|
||||
|
||||
```
|
||||
```clike
|
||||
typedef enum // Typical
|
||||
{ // Ghosting Update Time Usage
|
||||
UPDATE_MODE_INIT = 0, // * N/A 2000ms Display initialization,
|
||||
@@ -185,7 +185,7 @@ typedef enum // Typical
|
||||
|
||||
- **Function: Drawing images with Bmp file data**
|
||||
|
||||
```
|
||||
```clike
|
||||
bool drawBmpFile(fs::FS &fs, const char *path, uint16_t x, uint16_t y);
|
||||
bool drawBmpFile(fs::FS &fs, String path, uint16_t x, uint16_t y);
|
||||
```
|
||||
@@ -193,7 +193,7 @@ bool drawBmpFile(fs::FS &fs, String path, uint16_t x, uint16_t y);
|
||||
|
||||
- **Function: Draw images using Jpg file data**.
|
||||
|
||||
```
|
||||
```clike
|
||||
bool drawJpgFile(fs::FS &fs, const char *path, uint16_t x = 0,
|
||||
uint16_t y = 0, uint16_t maxWidth = 0, uint16_t maxHeight = 0,
|
||||
uint16_t offX = 0, uint16_t offY = 0,
|
||||
@@ -208,7 +208,7 @@ bool drawJpgFile(fs::FS &fs, String path, uint16_t x = 0,
|
||||
- **Function: Draw images using Png file data**.
|
||||
|
||||
|
||||
```
|
||||
```clike
|
||||
bool drawPngFile(fs::FS &fs, const char *path, uint16_t x = 0, uint16_t y = 0,
|
||||
uint16_t maxWidth = 0, uint16_t maxHeight = 0,
|
||||
uint16_t offX = 0, uint16_t offY = 0,
|
||||
@@ -222,7 +222,7 @@ bool drawPngFile(fs::FS &fs, String path, uint16_t x = 0, uint16_t y = 0,
|
||||
|
||||
- **Function: Draw images using memory Jpg data**.
|
||||
|
||||
```
|
||||
```clike
|
||||
bool drawJpg(const uint8_t *jpg_data, size_t jpg_len, uint16_t x = 0,
|
||||
uint16_t y = 0, uint16_t maxWidth = 0, uint16_t maxHeight = 0,
|
||||
uint16_t offX = 0, uint16_t offY = 0,
|
||||
@@ -231,7 +231,7 @@ bool drawJpg(const uint8_t *jpg_data, size_t jpg_len, uint16_t x = 0,
|
||||
|
||||
- **Function: Draw images using Jpg's Url/Network resource data**.
|
||||
|
||||
```
|
||||
```clike
|
||||
bool drawJpgUrl(String url, uint16_t x = 0,
|
||||
uint16_t y = 0, uint16_t maxWidth = 0, uint16_t maxHeight = 0,
|
||||
uint16_t offX = 0, uint16_t offY = 0, jpeg_div_t scale = JPEG_DIV_NONE);
|
||||
@@ -240,7 +240,7 @@ bool drawJpgUrl(String url, uint16_t x = 0,
|
||||
|
||||
- **Functions: Draw images using Png's Url/Network resource data**.
|
||||
|
||||
```
|
||||
```clike
|
||||
bool drawPngUrl(const char *url, uint16_t x = 0, uint16_t y = 0,
|
||||
uint16_t maxWidth = 0, uint16_t maxHeight = 0,
|
||||
uint16_t offX = 0, uint16_t offY = 0,
|
||||
@@ -250,7 +250,7 @@ bool drawPngUrl(const char *url, uint16_t x = 0, uint16_t y = 0,
|
||||
|
||||
**Example:**
|
||||
|
||||
```
|
||||
```clike
|
||||
#include <M5EPD.h>
|
||||
#include <WiFi.h>
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5EPD.h>
|
||||
|
||||
void setup() {
|
||||
@@ -22,7 +22,7 @@ void setup() {
|
||||
|
||||
**Function: detects device key status**
|
||||
|
||||
```
|
||||
```clike
|
||||
Button(uint8_t pin, uint8_t invert, uint32_t dbTime);
|
||||
uint8_t read();
|
||||
uint8_t isPressed();
|
||||
@@ -47,7 +47,7 @@ void setup() {
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
|
||||
if( M5.BtnL.wasPressed())
|
||||
{
|
||||
@@ -61,7 +61,7 @@ M5.update();
|
||||
|
||||
**Function: Read the temperature and humidity detected by the SHT30**.
|
||||
|
||||
```
|
||||
```clike
|
||||
float GetTemperature(TemperatureScale Degree = Cel);
|
||||
float GetRelHumidity();
|
||||
float GetAbsHumidity(AbsHumidityScale Scale = Torr);
|
||||
@@ -73,7 +73,7 @@ M5.update();
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5EPD.h>
|
||||
|
||||
char temStr[10];
|
||||
@@ -112,7 +112,7 @@ void loop()
|
||||
|
||||
## Related pin definitions
|
||||
|
||||
```
|
||||
```clike
|
||||
#define M5EPD_MAIN_PWR_PIN 2
|
||||
#define M5EPD_CS_PIN 15
|
||||
#define M5EPD_SCK_PIN 14
|
||||
@@ -166,7 +166,7 @@ void loop()
|
||||
|
||||
?>Please use `M5.RTC.begin();` to initialize RTC related functions before using
|
||||
|
||||
```
|
||||
```clike
|
||||
typedef struct RTC_Time
|
||||
{
|
||||
int8_t hour;
|
||||
@@ -231,7 +231,7 @@ Get RTC Date Struct
|
||||
**Example:**
|
||||
|
||||
|
||||
```
|
||||
```clike
|
||||
#include <M5EPD.h>
|
||||
|
||||
M5EPD_Canvas canvas(&M5.EPD);
|
||||
@@ -313,7 +313,7 @@ Turn off the power, pass in the RTC time structure specified for a certain point
|
||||
|
||||
**Example:**
|
||||
|
||||
```
|
||||
```clike
|
||||
#include <M5EPD.h>
|
||||
|
||||
M5EPD_Canvas canvas(&M5.EPD);
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
- **Function: Read touch finger information, return to structure instance**
|
||||
- `tp_finger_t readFinger(uint8_t num);`
|
||||
|
||||
```
|
||||
```clike
|
||||
typedef struct
|
||||
{
|
||||
uint16_t x;
|
||||
@@ -55,7 +55,7 @@ typedef struct
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5EPD.h>
|
||||
|
||||
M5EPD_Canvas canvas(&M5.EPD);
|
||||
|
||||
@@ -14,7 +14,7 @@ This function initialize MPU6500 chip.
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5Stack.h>
|
||||
#include "utility/MPU9250.h"
|
||||
|
||||
@@ -46,7 +46,7 @@ This function initialize AK8963 chip.
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5Stack.h>
|
||||
#include "utility/MPU9250.h"
|
||||
|
||||
@@ -91,7 +91,7 @@ This function calcurate offset values of gyro and accelerometer.
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5Stack.h>
|
||||
#include "utility/MPU9250.h"
|
||||
|
||||
@@ -140,7 +140,7 @@ This function reads a byte data from specified register of MPU9250.
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5Stack.h>
|
||||
#include "utility/MPU9250.h"
|
||||
|
||||
@@ -174,7 +174,7 @@ This function reads the value of 3-axis gyro sensor.
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5Stack.h>
|
||||
#include "utility/MPU9250.h"
|
||||
|
||||
@@ -226,7 +226,7 @@ This function reads the value of 3-axis accelerate sensor.
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5Stack.h>
|
||||
#include "utility/MPU9250.h"
|
||||
|
||||
@@ -274,7 +274,7 @@ This function reads the temperature.
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5Stack.h>
|
||||
#include "utility/MPU9250.h"
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
Use initialization, communication check, and control in this order, as shown in the example below.
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
M5.Power.begin();
|
||||
if(!M5.Power.canControl()) {
|
||||
//can't control.
|
||||
@@ -426,7 +426,7 @@ No return value.
|
||||
|
||||
**Example of use:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
setWakeupButton(BUTTON_A_PIN);
|
||||
```
|
||||
|
||||
@@ -549,7 +549,7 @@ After waking up, the CPU will be restarted instead of running from the next line
|
||||
|
||||
**Example of use:**
|
||||
Save energy for 5 seconds and then restart.
|
||||
```arduino
|
||||
```clike
|
||||
deepSleep(SLEEP_SEC(5));
|
||||
```
|
||||
|
||||
@@ -569,7 +569,7 @@ Power saving capability is lacking compared to deepSleep().
|
||||
|
||||
**Example of use:**
|
||||
Save energy for 5 seconds and then restart.
|
||||
```arduino
|
||||
```clike
|
||||
lightSleep(SLEEP_SEC(5));
|
||||
```
|
||||
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
**Description:Output waveform to the channel channel according to the specified duty cycle.**
|
||||
|
||||
**Example:**
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
int freq = 1800;
|
||||
int channel = 0;
|
||||
|
||||
+4
-4
@@ -10,7 +10,7 @@ Set time with the value of the structure member variable
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
RTC_TimeTypeDef TimeStruct;
|
||||
@@ -37,7 +37,7 @@ Get time with the value of the structure member variable
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
|
||||
#include <M5StickC.h>
|
||||
|
||||
@@ -77,7 +77,7 @@ Set date with the value of the structure member variable
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
|
||||
#include <M5StickC.h>
|
||||
|
||||
@@ -108,7 +108,7 @@ Get date with the value of the structure member variable
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
RTC_DateTypeDef DateStruct;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
void setup() {
|
||||
@@ -35,7 +35,7 @@ void loop() {}
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
int16_t gyroX, gyroY, gyroZ;
|
||||
@@ -65,7 +65,7 @@ void loop() {
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
int16_t accX, accY, accZ;
|
||||
@@ -96,7 +96,7 @@ void loop() {
|
||||
|
||||
**Example:**
|
||||
|
||||
```arduino
|
||||
```clike
|
||||
#include <M5StickC.h>
|
||||
|
||||
float temp = 0;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user