M5Stack的所有产品的例程和案例程序都会上传到这个仓库来管理.
你可以在这个仓库中找到很多M5Stack产品相关的例程,参考这些例程之后,你可以更好的开发使用M5的产品。
原理图仓库:
All example codes of products supplied by M5Stack have been collected in this reposity.
License: MIT License
M5Stack的所有产品的例程和案例程序都会上传到这个仓库来管理.
你可以在这个仓库中找到很多M5Stack产品相关的例程,参考这些例程之后,你可以更好的开发使用M5的产品。
原理图仓库:
When will Thermal camera support on M5core2?
The header file has the getAhrsData(&pitch,&roll,&yaw) method but the implementation is missing in the .cpp file.
The implementation could be copied from the M5.IMU implementation to fix this.
The unit is IMU_6886.cpp
It appears this line is using the wrong pin, if you compare button codes in loop().
I get no response from keyboard example
Do I need to flash the CardKeyBaord.ino first ?
Hello,
could you please give an example of how to get the data returned from the server on a different device, not the Echo,
I know it is possible as it works in UIflow, but I need it in Arduino code.
Thank you
https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Base/LAN/Arduino
exit status 1
cannot declare variable 'server' to be of abstract type 'EthernetServer'
Hello, I am using unit cam with a Core 2. I want to communicate through UART, just like the video on that page. I followed the connections given, and uploaded the arduino sketch. After doing so, the blue LED blinks for three times then my previous firmware completely freezes and nothing else works. I have attempted to to erase the previous firmware, then uploading the arduino sketch. Nothing.
I have tried to use the m5flow programming blocks, yet there is no support for the unit? I attempt to click on it, yet it is grayed out. See this image.
I don't understand, am I doing something wrong?
Hello, when I try to open the RFID file for UIFlow, nothing shows up (it works well with other M5F files).
Also, when using the code from Arduino IDE, it says "no matching function for call to 'MFRC522::MFRC522(int)'".
Can anyone help me with that please?
No function works because of a timeout in fpm_sendAndReceive.
Hi
Do you have an example on how to connect the Lorawan Module to the TTN network?
Thanks
Hello,
I'm trying to get speed of movement of GPS module (AtomicGPS) using your example code via GPS.s_GNRMC.TrackSpeed
parameter from GPSAnalyse::AnaGPRMC
function in GPSAnalyse.cpp
.
It seems this parameter returns speed values but in unknown (for me) scale.
I've compare with speed measurement with my car measurement (kmh) and it seems AtomicGPS, results about half of the real speed (there is correlation).
What is unit of measurement returned by this function in example library??
Regards,
M
What pins do I need to connect UnitCam to?
I think "xQueueReceive(jpeg_fream_queue, &frame, portMAX_DELAY);" is failing.
I am trying to open the STEPMOTOR.m5f example file found here, and it will not open in UIFlow online or Desktop.
https://github.com/m5stack/M5-ProductExampleCodes/tree/master/AtomBase/Atomic_StepMotor/UIFlow
Please advise.
Regards,
David
Would you clarify the licensing of the code examples?
@Kiko62 could you suggestion any ideas about what version you can compile?
I tried different esp32 versions (1.0.2-1.0.5) in board manager but also failed.
Choose board m5stick-c.
Compiliation erro with arduino ide 1.8.13
sketch\joyc.ino.cpp.o:(.literal._Z4loopv+0x8): undefined reference to `connect_off'
sketch\joyc.ino.cpp.o:(.literal._Z5setupv+0x3c): undefined reference to `connect_on'
Compilation error with platform.io
.pio\build\m5stick-c\src\joyc.ino.cpp.o:(.literal._Z4loopv+0x8): undefined reference to `connect_off'
.pio\build\m5stick-c\src\joyc.ino.cpp.o:(.literal._Z5setupv+0x40): undefined reference to `connect_on'
best M5stack designer. I am looking for this file https://github.com/m5stack/M5-ProductExampleCodes/blob/master/Unit/TVOC/UIFlow/TVOC_eCO2%20Example.m5f.
but unfortunately it is no longer listed where can I find it again? thanks in advance Harry
Line 74 and 75... there's one too many function declarations with the same name.
74: void readGyro();
75: void readGyro();
Since the AT Commands Manual is in chinese, and the at commands for connecting to bearer and making http post and get are completely different from sim800l modem, it would be nice some code examples demonstrating how to properly connect to the bearer via gprs and make get and post requests to websites.
Hi
I tried out the LoRaWAN examples with the M5 COM.X LoRaWAN module. It doesn't work and after some troubleshooting it turns out that for most of the commands sent to the LoRA module, the response is +ERROR: Command does not exist
Also really important to notice is that if you run it with a Core2 you need to replace the M5Stack.h include with M5Core2.h and comment out lora.init();
and replace it with Serial2.begin(115200, SERIAL_8N1, 13, 14);
because the M-bus pinout is different.
And finally replace M5.begin();
with M5.begin(true, true, true, false, kMBusModeInput);
It could be a good idea to have this info in the beginning of the .ino
But none of the above changes will make it work, as long as the commands in the lib are non-existent.
Hi,
just got my ENV unit and wanted to bring it alive with my M5stack and unfortunately it is not working. The example code in Unit/ENV/Arduino/ENV/ENV.ino
gives me this:
20:39:16.008 -> M5Stack initializing...OK
20:39:16.650 -> ENV Unit(DHT12 and BMP280) test...
20:39:16.650 -> Could not find a valid BMP280 sensor, check wiring!
When I try my own code on it with following code:
if (!bme.begin(0x76)){
Serial.println("Could not find a valid BMP280 sensor, check wiring!");
while (1);
}
Then it will work.
Just trying to compile the Core2_Factory_test example code gives me the following error in the Arduino IDE:
/home/koan/M5-ProductExampleCodes/Core/M5Core2/Arduino/Core2_Factory_test/Core2_Factory_test.ino: In function 'bool InitI2SSpakerOrMic(int)':
Core2_Factory_test:304:20: error: 'struct i2s_config_t' has no member named 'tx_desc_auto_clear'
i2s_config.tx_desc_auto_clear = true;
This is on Arduino 1.8.13 with the esp32 1.0.4 board support from Espressif, and the M5Core2 0.0.1 library installed.
Any pointers to what could be wrong?
In the files:
there is waiting after a Wire.requestFrom()
.
You may remove all these lines: while (Wire.available() < 1) delay(1);
In the files:
there is a delay after the Wire.requestFrom()
. That is delay is not needed for interfacing with the Wire library.
In the file:
you may remove this line: while (Wire.available() < 1);
Explanation: Common-mistakes#1
Sketch is too large when compiled with M5Stick Core on Arduino IDE 1.8.13 (should a different core be used?)
Changing "partition scheme" to No OTA large app allows the sketch to compile and upload
The device gives a PSRAM malloc failed error on the screen, tapping the screen will get past it.
but the screen doesn't display correctly.
touching the imu block, doesn't update the screen, or the imu.
I've tried to load the Bala2 example code several times and all I get is a blank screen and no motor actions at all.
Downloaded from here:
https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Application/Bala2
Using Board:
M5Stack-Core-ESP32
https://github.com/m5stack/M5-ProductExampleCodes/blob/master/Unit/KEY/UIFLOW/Unit-Key_noBlock.m5f
The UiFlow sample of Unit Key is not the m5f file but the HTML file.
Have a new COM.NB-IoT (SIM7020G) with Core2 but can't get get anything much to work.
Have an external 5v power supply for the COM.NB-IoT and inserted a SIM card and attached to the Core2. POwering on the external power supply starts LEDs flashing in the COM.NB-IoT and the Core2 boots up, so that looks like its all connected together properly.
Flashing the Core2 with the EasyLoader from the COM.NB-IoT doc page and connecting a Serial Monitor shows:
M5Stack initializing... AT+CSQ
AT+CSQ
AT+CSQ
AT+CSQ
with the AT+CSQ repeating every 10 seconds.
So it looks like there is a problem with the serial connection to the COM.NB-IoT.
Hunting around I found this repo, and in there this example: https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Module/COMX_NB-IoT
That uses #include <M5Stack.h> which doesn't appear to work with the Core2 so changing it to #include <M5Core2.h> and adding #include <AXP192.h> to fix another compile error, and this doc page https://shop.m5stack.com/products/com-nb-iot-modulesim7020g talks about changing the M5 and Serial2 begin, so I've done that and this is the diff to this repo:
git diff
diff --git a/Module/COMX_NB-IoT/COMX_NB-IoT.ino b/Module/COMX_NB-IoT/COMX_NB-IoT.ino
index 50a9284..b322485 100644
--- a/Module/COMX_NB-IoT/COMX_NB-IoT.ino
+++ b/Module/COMX_NB-IoT/COMX_NB-IoT.ino
@@ -1,4 +1,5 @@
-#include <M5Stack.h>
+#include <M5Core2.h>^M
+#include <AXP192.h>^M
#include <stdint.h>
#include <vector>
#include "TFTTerminal.h"
@@ -303,8 +304,10 @@ uint8_t restate;
void setup()
{
// put your setup code here, to run once:
- M5.begin();
- Serial2.begin(115200, SERIAL_8N1, 5, 13);
+ //M5.begin();^M
+ //Serial2.begin(115200, SERIAL_8N1, 5, 13);^M
+ M5.begin(true, true, true, false, kMBusModeInput);^M
+ Serial2.begin(115200, SERIAL_8N1, 13, 14);^M
Disbuff.createSprite(320,20);
Disbuff.fillRect(0,0,320,20,BLACK);
diff --git a/Module/COMX_NB-IoT/TFTTerminal.h b/Module/COMX_NB-IoT/TFTTerminal.h
index 6142e42..2b6d1d6 100644
--- a/Module/COMX_NB-IoT/TFTTerminal.h
+++ b/Module/COMX_NB-IoT/TFTTerminal.h
@@ -1,7 +1,7 @@
#ifndef _TFTTERMINAL_H_
#define _TFTTERMINAL_H_
-#include <M5Stack.h>
+#include <M5Core2.h>^M
#include <Print.h>
class TFTTerminal : public Print
Flashing the Core2 with that and connecting serial monitor shows this and just the repeating AT+CSQ:
ets Jul 29 2019 12:21:46
rst:0x1 (POWERON_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1184
load:0x40078000,len:12804
ho 0 tail 12 room 4
load:0x40080400,len:3032
entry 0x400805e4
M5Core2 initializing...axp: vbus limit off
axp: gpio1 init
axp: gpio2 init
axp: rtc battery charging enabled
axp: esp32 power voltage was set to 3.35v
axp: lcd backlight voltage was set to 2.80v
axp: lcd logic and sdcard voltage preset to 3.3v
axp: vibrator voltage preset to 2v
E (1435) ledc: ledc_channel_config(369): gpio_num argument is invalid
touch: FT6336 ready (fw id 0x10 rel 1, lib 0x300E)
OK
AT+CSQ
AT+CSQ
AT+CSQ
...
What am I doing wrong?
Thanks for any help!
This function warns that I2C devices are not found.
In the M5Core2 library, Pin definition of Wire and Wire1 are the same and Wire is not valid.
`
int checkI2cAddr(){
uint8_t count = 0;
i2cDevice_t *lastptr = &i2cParentptr;
do{
lastptr = lastptr->nextPtr;
Serial.printf("Addr:0x%02X - Name:%s\r\n",lastptr->addr,lastptr->Name.c_str());
// Wire.beginTransmission( lastptr->addr );
Wire1.beginTransmission( lastptr->addr );
// if ( Wire.endTransmission() == 0 )
if ( Wire1.endTransmission() == 0 )
{
`
There is a bug in the slot machine demo which causes affects the shadowing effect that is composited on the top and bottom of the spinning slot machine wheels. This bug causes the line on the very first and last row of the screen (which should be the darkest) to be full brightness.
In the file Slot.cpp (inside of the ZIP archive in App/M5StickC_Slot/), line 154 should look like this:
for (int i = 0; i < shadowHeight; i++) {
Currently this for loop starts with "int i = 1", which causes the darkest line of the shadow to have an undefined brightness value.
I was unable to compile the PDM unit code
Arduino: 1.8.19 (Windows 10), Board: "M5Stack-Core-ESP32, QIO, 80MHz, Default, 921600, Error"
C:\Users\andre\AppData\Local\Temp\arduino_modified_sketch_309659\sketch_feb11a.ino: In function 'bool InitI2SSpakerOrMic(int)':
C:\Users\andre\AppData\Local\Temp\arduino_modified_sketch_309659\sketch_feb11a.ino:43:29: warning: 'I2S_COMM_FORMAT_I2S' is deprecated [-Wdeprecated-declarations]
.communication_format = I2S_COMM_FORMAT_I2S, // Set the format of the communication. 设置通讯格式
^~~~~~~~~~~~~~~~~~~
In file included from C:\Users\andre\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.2/tools/sdk/esp32/include/driver/include/driver/i2s.h:16,
from C:\Users\andre\AppData\Local\Temp\arduino_modified_sketch_309659\sketch_feb11a.ino:19:
C:\Users\andre\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.2/tools/sdk/esp32/include/hal/include/hal/i2s_types.h:95:5: note: declared here
I2S_COMM_FORMAT_I2S __attribute__((deprecated)) = 0x01, /*!< I2S communication format I2S, correspond to `I2S_COMM_FORMAT_STAND_I2S`*/
^~~~~~~~~~~~~~~~~~~
c:/users/andre/appdata/local/arduino15/packages/m5stack/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: sketch\sketch_feb11a.ino.cpp.o:(.literal._ZL15i2sMicroFFTtaskPv+0x28): undefined reference to `fft_init(int, fft_type_t, fft_direction_t, float*, float*)'
c:/users/andre/appdata/local/arduino15/packages/m5stack/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: sketch\sketch_feb11a.ino.cpp.o:(.literal._ZL15i2sMicroFFTtaskPv+0x2c): undefined reference to `fft_execute(fft_config_t*)'
c:/users/andre/appdata/local/arduino15/packages/m5stack/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: sketch\sketch_feb11a.ino.cpp.o:(.literal._ZL15i2sMicroFFTtaskPv+0x38): undefined reference to `fft_destroy(fft_config_t*)'
c:/users/andre/appdata/local/arduino15/packages/m5stack/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: sketch\sketch_feb11a.ino.cpp.o: in function `i2sMicroFFTtask(void*)':
C:\Users\andre\AppData\Local\Temp\arduino_modified_sketch_309659/sketch_feb11a.ino:93: undefined reference to `fft_init(int, fft_type_t, fft_direction_t, float*, float*)'
c:/users/andre/appdata/local/arduino15/packages/m5stack/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\andre\AppData\Local\Temp\arduino_modified_sketch_309659/sketch_feb11a.ino:97: undefined reference to `fft_execute(fft_config_t*)'
c:/users/andre/appdata/local/arduino15/packages/m5stack/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\andre\AppData\Local\Temp\arduino_modified_sketch_309659/sketch_feb11a.ino:115: undefined reference to `fft_destroy(fft_config_t*)'
collect2.exe: error: ld returned 1 exit status
Multiple libraries were found for "SD.h"
Used: C:\Users\andre\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.2\libraries\SD
Not used: C:\Program Files (x86)\Arduino\libraries\SD
Multiple libraries were found for "WiFiClient.h"
Used: C:\Users\andre\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.2\libraries\WiFi
Not used: C:\Program Files (x86)\Arduino\libraries\WiFi
exit status 1
Error compiling for board M5Stack-Core-ESP32.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
To get the PDM sample working, the line
pin_config.mck_io_num = GPIO_NUM_0;
needs to be added after
pin_config.data_in_num = CONFIG_I2S_DATA_IN_PIN;
Is there an example to show how to perform TTS? Takes text input and convert to speech.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.