I assume that I a am not the first one to ask, but how can I select other fonts? Thanks
Best posts made by HappyUser
-
Core-Ink --> Any other fonts available besides the two included
-
Atom Echo. Format and create sound file
I have been googling around, no understandable answers found. But I am sure I am not the only one with this interest.
Could anyone explain the binary format of the sound stream used in the echo? And also nice to have : howto proces a mp3 or wav file into the required binary array to be used in the Echo?
Thanks. -
RE: STAMP CATM does not respond (Solved, HTML Get and Send Email)
@happyuser
A few tips who want to start with this module:
1] Remove PIN code, makes life much easier
2] Download the application notes for this module. Both the complete AT instruction set and the note on HTTP application. This document provides clear instructions how to use HTTP, GET, POST etc
3] I experienced ERROR response on SHCONF command. Googled around, saw numerous hits. It appears that switching off and on power does the trick for me. I did not see a reset AT instruction
4] I got it all working with these instructions :
Serial.println("Begin..");
//pinMode(RXD2, INPUT);
//pinMode(TXD2, OUTPUT);
//showLog("Reset Module...");
//SIM7020
//DTU.Init(&Serial1,36, 26);
//Serial1.begin(115200, SERIAL_8N1, RXD2, TXD2);
//Serial1.begin(115200, SERIAL_8N1, 26, 0);
Serial1.begin(115200, SERIAL_8N1, 0, 26); // SIM7080Gdelay(300); //Serial1.print("ATI\r\n"); //Serial1.println("AT+CSQ\r\n"); //Serial1.println("AT+IPR?\r\n"); Serial1.print("ATZ\r\n"); // Reset to default delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+IPR=115200\r\n"); // Reset to default delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+CCLK?\r\n"); // Reset to default delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+SHSSL=1,\"\"\r\n"); // Reset to default delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+CFUN=1\r\n"); // delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+CMGF=1\r\n"); // text mode delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500);
// Om http te testen
Serial1.print("AT+CFUN=0\r\n"); // Disable RF delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500); //Serial1.print("AT+CGDCONT=1,\"IP\",\"internet\",,0,0\r\n"); // Serial1.print("AT+CGDCONT=1,\"IP\",\"internet\"\r\n"); // delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+CFUN=1\r\n"); // Enable RF delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+CGATT?\r\n"); // Check PS Service delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+CGNAPN\r\n"); // Query the APN service delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+CNCFGN=0,1,\"internet\",,0,0\r\n"); // Before activation please delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+CNACT=0,1\r\n"); // Activate delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+CNACT?\r\n"); // Query the APN service delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+SHCPARA\r\n"); // delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+SHCONF=?\r\n"); // delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+SHCONF?\r\n"); // delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500);
// Serial1.print("AT+SHCONF="URL","https://api.thingspeak.com/update"\r\n"); // Query the APN service
//Serial1.print("AT+SHCONF="URL","httpbin.org"\r\n"); // Query the APN service
//Serial1.print("AT+SHCONF="URL","http://34.193.132.77"\r\n"); // Query the APN service//SIM7600_Error=1; //for (int i=0;i<10;i++) // { //Serial1.print("AT+SHCONF=\"URL\",\"http://www.google.com\"\r\n"); // Query the APN service Serial1.print("AT+SHCONF=\"URL\",\"http://www.httpbin.org\"\r\n"); // Query the APN service delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(2000); // if (SIM7600_Error=0) {break;} // } Serial1.print("AT+SHCONF=\"BODYLEN\",1024\r\n"); // delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+SHCONF=\"HEADERLEN\",350\r\n"); // delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+SHCONN\r\n"); // Query the APN service delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+SHSTATE?\r\n"); // Query the APN service delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+SHCHEAD\r\n"); // Query the APN service delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+SHAHEAD=\"User-Agent\",\"curl/7.47.0\"\r\n"); // delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+SHAHEAD=\"Cache-control\",\"no-cache\"\r\n"); // delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+SHAHEAD=\"Connection\",\"keep-alive\"\r\n"); // delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+SHAHEAD=\"Accept\",\"*/*\"\r\n"); // delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+SHREQ=\"/get?user=jack&password=123\",1\r\n"); // delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+SHREAD=0,391\r\n"); // delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500);
-
RE: M5 paper reading google sheet
@paulpattyn Uh, how about use Google : https://www.instructables.com/Post-to-Google-Docs-with-Arduino/
Regards -
RE: ATOM Lite Display not display in smallHd 503
@cepics said in ATOM Lite Display not display in smallHd 503:
SmallHD503 datasheet
I read that you are also struggling with this (5 inch?) display. I am facing the same issues with Waveshare 5inch display. Although I have the very strong feeling that the software on the M5AtomDisplay as shipped is different from the GitHub factory test. Have you been able to get things working?
-
RE: SIM7080G CAT-M/NB-IoT+GNSS Unit Issues
#include <HardwareSerial.h>
HardwareSerial Comm(1);Comm.begin(115200, SERIAL_8N1,TX_pin,RX_pin); // TX RX
Comm.print("AT+IPR=115200\r"); // Set text mode
Last command should return an OK. If not, it could be that you have mixed up TX and RX pins or a power issue.
To read the reply from the module you could use something like this :
while (millis()<wait_until)
{
while (Comm.available())
{
ccc=Comm.read();
//Serial.print(ccc);
if (k<buffer_size-1)
{
Receive_buffer[k]=ccc;
k++;
}
}
Receive_buffer[k]=NULL;
if (strstr(Receive_buffer,StopCharArray)!=NULL)
{
//Serial.println("OK found");
// SIM7600_Error=0;
Receive_buffer[k]=NULL;
return false;
}
} -
RE: STAMP CATM does not respond (Solved, HTML Get and Send Email)
Okay, Had a lot of <bad language> getting sending email working.
Than I realized that powering the module straight from the M5StickC appeared to causes glitches. I have placed a capacitor on top of the 5Volt to the module and now I am able to send emails also. For those that are interested, here is the code (with a lot of overhead no doubt, that works for me ):
Serial1.begin(115200, SERIAL_8N1, 0, 26); // SIM7080Gdelay(300); //Serial1.print("ATI\r\n"); //Serial1.println("AT+CSQ\r\n"); //Serial1.println("AT+IPR?\r\n"); Serial1.print("ATZ\r\n"); // Reset to default delay(10); Read_Response_OK(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+CREBOOT\r\n"); // Reset to default delay(10); Read_Response_OK(5000); Serial.println(Receive_buffer); delay(500);
/*
Serial1.print("AT+CMEE=2\r\n"); // Verbose error printing ??
delay(10);
Read_Response_OK(5000);
Serial.println(Receive_buffer);
delay(500);
*/Serial1.print("AT+IPR=115200\r\n"); // SetTE-TAFixedLocalRate delay(10); Read_Response_OK(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+CCLK?\r\n"); // Clock delay(10); Read_Response_OK(5000); Serial.println(Receive_buffer); delay(500);
// Upload a file
Serial1.print("AT+CFSINIT\r\n"); // Clock delay(10); Read_Response_OK(5000); Serial.println(Receive_buffer); delay(500);
String Command_Str;
Command_Str="AT+CFSWFILE=0,"0001.txt",0,";
Command_Str=Command_Str+FileSize;
Command_Str=Command_Str+",10000\r\n";
Serial.println(Command_Str);Serial1.print(Command_Str); delay(10); Read_Response_OK(5000); Serial.println(Receive_buffer); delay(500); for (int i=0;i<FileSize;i++) {Serial1.print(jpg_small[i]);} Serial1.print("AT+CFSGFIS=0,\"0001.txt\"\r\n"); // delay(10); Read_Response_OK(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+CPIN?\r\n"); // Ccheck SIM delay(10); Read_Response_OK(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+CSQ\r\n"); // Check signal delay(10); Read_Response_OK(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+CFUN=0\r\n"); // Set Phone Functionality isable RF delay(10); Read_Response_OK(5000); Serial.println(Receive_buffer); delay(500); //Serial1.print("AT+CGDCONT=1,\"IP\",\"internet\",,0,0\r\n"); // Serial1.print("AT+CGDCONT=1,\"IP\",\"internet\"\r\n"); // Define PDP Context delay(10); Read_Response_OK(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+CFUN=1\r\n"); // Set Phone Functionality Enable RF delay(10); Read_Response_OK(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+CGATT?\r\n"); // Attach or detach from GPRS service delay(10); Read_Response_OK(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+CGNAPN\r\n"); // Get Network APN in CAT-M or NB-IOT Query the APN service delay(10); Read_Response_OK(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+CNCFGN=0,1,\"internet\",,0,0\r\n"); // Before activation please delay(10); Read_Response_OK(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+CNACT=0,1\r\n"); // APP Network Active Activate delay(10); Read_Response_OK(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+CNACT?\r\n"); // APP Network Active Activate Query the APN service delay(10); Read_Response_OK(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+EMAILCID=0\r\n"); // Set parameters of email delay(10); Read_Response_OK(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+EMAILTO=30\r\n"); // Set parameters of email time out delay(10); Read_Response_OK(5000); Serial.println(Receive_buffer); delay(500);
/*
Serial1.print("AT+EMAILSSL=2,0,"email.cer","email.pem"\r\n"); // Set Encrypted mail
delay(10);
Read_Response_OK(5000);
Serial.println(Receive_buffer);
delay(500);
*/
// https://randomnerdtutorials.com/esp32-send-email-smtp-server-arduino-ide/Serial1.print("AT+SMTPSRV=\"smtp-mail.outlook.com\",587\r\n"); // Set SMTP server delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500);
//SMTP Password: (you need to use a Google App Password, not your Gmail password!)
//https://support.google.com/accounts/answer/185833
// https://www.hesk.com/knowledgebase/index.php?article=72Serial1.print("AT+SMTPAUTH=1,\"my.email.com\",\"myApppassword\"\r\n"); // Set username and password
delay(10);
Read_Response(5000);
Serial.println(Receive_buffer);
delay(500);Serial1.print("AT+SMTPCS=\"ASCII\"\r\n"); // Set Email SSL function delay(10); Read_Response_OK(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+EMAILSSL?\r\n"); // Read Email SSL function delay(10); Read_Response_OK(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+EMAILSSL=2,0,\"\",\"\"\r\n"); // Set Email SSL function delay(10); Read_Response_OK(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+EMAILSSL?\r\n"); // Read Email SSL function delay(10); Read_Response_OK(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+SMTPFROM=\"my.email@outlook.com\",\"Fakename\"\r\n"); // Set username and password delay(10); Read_Response_OK(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+SMTPRCPT=0,0,\"Sendto@mac.com\",\"john\"\r\n"); // Set recipient To: delay(10); Read_Response_OK(5000); Serial.println(Receive_buffer); delay(500); Serial1.print("AT+SMTPSUB=\"Test4\"\r\n"); // Set recipient Bcc: delay(10); Read_Response_OK(5000); Serial.println(Receive_buffer); delay(500);
String Email_Body="This is a new Email";
int Body_size;
Body_size=Email_Body.length();
Serial.print("Body size is :");
Serial.println(Body_size);Serial1.print("AT+SMTPBODY=19\r\n"); // Set recipient Bcc: delay(10); Read_Response_OK(5000); //Serial.println(Receive_buffer); //delay(500); Serial1.print(Email_Body); //Serial1.print("\r\n"); delay(10); Read_Response(5000); Serial.println(Receive_buffer); delay(500);
char ccc;
Serial.println("AT+SMTPSEND");
Serial1.print("AT+SMTPSEND\r\n"); //
delay(10);
while (Serial1.available())
{
ccc=Serial1.read();
Serial.print(ccc);
}/*
Read_Response(5000); //Geen OK
Serial.println(Receive_buffer);
delay(500);
*/
Serial.println("And we are done");
while (1) {delay(300);} -
RE: Remote Sensing with Core2 (UIFlow) via LORA Point-to-point
Interesting question. M5Stack provides P2P LoRa example along with their documents. My suggestion is to make a proof of principle what you need. Then try the max achievable distance. Mqtt is another challenge but also many examples on GitHub.
-
RE: STAMP-C3 problem with Serial2
Solved
I don't why I have been klinging on to Serial2, it got me in all kind of testing out, but the solution is to use Serial 1. -
RE: RFID 2 unit and I2C hub 1 to 6 expansion unit
@laursena please check the version of ClosedCube.cpp and ClosedCube.h you are using. The one that is provided by M5stack is the newest.
(* In the examples of M5StickCPlus in the directory Unit/PaHub you may find these documents. *)
Latest posts made by HappyUser
-
RE: Trying to get this LoRa Module working on Core2
@felmue Dear Felix,
Actually, we have done nearly the same thing.
We have connected this module: HopeRF RFM95W to the connectors on the back of the Core2. That works great.
We have no idea why the LoRa module does not work with the Core2. Maybe a SPI conflict somewhere deep in the background, maybe a power issue or maybe, and more likely, we are lacking some understanding.
Anyway, we have decided to use a Proto board, solder the LoRa module on it and place that on the backside of the Core2.
We have to do that for 35 devices, but it is fail save.
Thanks for all the effort
Regards -
RE: Trying to get this LoRa Module working on Core2
@felmue Thank you.
We are struggling really hard with the M5Unified library. We tried getting things working using startwrite and endwrite at the correct places, and also without using (as you suggested). The problems that we are facing is that sometimes the display lights up after a restart and sometimes it does not. We dont believe it is a faulty device because we se it happening with different M5Core2.We are diving into it. Maybe i will make a new post discribing the problems (and hopefuly solutions) that we are facing with M5Unified.
For now, we dont dare to update our devices in the field because there is no turning back.
Regards -
RE: Trying to get this LoRa Module working on Core2
@felmue Thank you.
Pins are assigned correctly. Double checked.
Not shown but this piece of codeauto cfg = M5.config(); cfg.serial_baudrate = 115200; cfg.output_power = true; cfg.led_brightness=180; M5.begin(cfg); M5.Power.begin();``` Handles the power. Tested out : if we remove M5.Display.startWrite(); then Lora.begin works great. However, we need to startup the display also. So, I strongly beleive there is some interference with SPI and startWrite(). No idea how. Regards Regards
-
Trying to get this LoRa Module working on Core2
/*
After some further trial and error and comparison of what works and what not works.
In this piece of code :auto cfg = M5.config(); cfg.serial_baudrate = 115200; cfg.output_power = true; M5.begin(cfg); M5.Power.begin(); M5.Display.startWrite();
The problem starts with M5.Display.startWrite(); If we remove that one, LoRa.begin(LORA_FREQ)) works fine.
So I assume that there is some kind of SPI conflict.
Then the next question is : i need to keep both the startwrite because i use M5Unified and I wnat to connect to the Lora module.Is this info a better pointer to find a solution?
Thanks*/
Hi,
We are trying to get this LoRa module : ```
https://docs.m5stack.com/en/module/lora868working in a M5Core2. We realize that this module is no longer supported. But we have a lot of them operational in the field, and for several reasons we need to upgrade from M5Stack the grey on to M5Core2. I have included our testing code. We are using the M5_SX127X.h which works great with the M5Stack grey one. We also updated the pins to the Core2 (when the LoRa module is stcked on the Core 2. This piece of code tells us that SPI is started:
if (SPI.begin(LORA_SCLK, LORA_MISO, LORA_MOSI,-1)) // SCK, MISO, MOSI, SS { Serial.println("Fine");} else {Serial.println("Not fine");}
We are not sure about this one : LoRa.setSPIFrequency(300000); // Not sure , we tried different values also left this out, to no avail. The software hangs inside this call LoRa.begin(LORA_FREQ) , which looks like the SPI transmission with the LoRa device hangs. But we have no idea. Double checked the pin assignments, we beleive they are correct. Anyone a suggestion how to get this LoRa module working on an M5Core2? Thanks However,
#include <arduino.h>
#include <M5Unified.h>
#include <SPI.h>
#include "M5_SX127X.h"#include <Wire.h> //The DHT12 uses I2C comunication.
#include <WiFi.h>
#include <WiFiClient.h>#include <WiFiMulti.h>
#include <HTTPClient.h>#include <EEPROM.h>
#define EEPROM_SIZE 1
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS GPIO_NUM_26 //9
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);// Module Connect Pins Config
// Core
/*
#define CS_PIN 5
#define RST_PIN 26 //13
#define IRQ_PIN 36 //34#define LORA_MISO 19
#define LORA_MOSI 23
#define LORA_SCLK 18
*/
// Core2
#define CS_PIN 33 //5
#define RST_PIN 25 //26 //13
#define IRQ_PIN 36 //36 //36 //34#define LORA_MISO 38 //19
#define LORA_MOSI 23 //23
#define LORA_SCLK 18 //18// LoRa Parameters Config
// #define LORA_FREQ 433E6
#define LORA_FREQ 868E6
#define LORA_SF 12
#define LORA_BW 125E3
#define LORA_TX_POWER 17/*
// Module Connect Pins Config
#define CS_PIN 5
#define RST_PIN 13
#define IRQ_PIN 34#define LORA_MISO 19
#define LORA_MOSI 23
#define LORA_SCLK 18// LoRa Parameters Config
// #define LORA_FREQ 433E6
#define LORA_FREQ 868E6
#define LORA_SF 12
#define LORA_BW 125E3
#define LORA_TX_POWER 17
*///**************************** LoRa
int packetSize;
int LoRa_Pulse_Count_Max=0; // Om de WindGust te bepalen
int LoRa_Counter_Cumm=0;
int LoRa_Windspeed_Counter=0;
float LoRa_Windspeed_Avg=0;float LoRa_Outside_Temperature;
int LoRa_Pulse_Count;
float LoRa_Wind_Speed;
float LoRa_WindGust;const int LoRa_Pulse_Array_size= 400; // inschatting
int LoRa_Pulse_Array[LoRa_Pulse_Array_size];const long Ten_Minutes=600000;
long Next_Ten_Minutes;typedef struct {
int SecretCode;
int Pulse_Count;
int CallCounter;
//float Current;
//float Voltage;
float tempC;} LoRa_Receive_struct;
LoRa_Receive_struct LoRa_Receive_Data;//***************************** End of LoRa
void setup() {
Serial.begin(115200);
//pinMode(CS_PIN,OUTPUT);
//pinMode(RST_PIN,OUTPUT);
Serial.println("LoRa Receiver");
if (SPI.begin(LORA_SCLK, LORA_MISO, LORA_MOSI,-1)) // SCK, MISO, MOSI, SS
{ Serial.println("Fine");} else {Serial.println("Not fine");}
LoRa.setSPI(&SPI);
LoRa.setPins(CS_PIN, RST_PIN, IRQ_PIN); // set CS, reset, IRQ pin
LoRa.setSPIFrequency(300000); // Not sure , we tried different values
while (!LoRa.begin(LORA_FREQ)) {
Serial.println("LoRa init fail.");
delay(1000);
}
Serial.println("Seems okay");//LoRa.setTxPower(LORA_TX_POWER); //LoRa.setSignalBandwidth(LORA_BW); //LoRa.setSpreadingFactor(LORA_SF);
}
void loop() {
// try to parse packet
int packetSize = LoRa.parsePacket();
if (packetSize) {
// received a packet
Serial.print("Received packet '");
LoRa.readBytes((uint8_t *)&LoRa_Receive_Data, packetSize);
if (LoRa_Receive_Data.SecretCode==5498)
{Serial.print("LoRa :"); Serial.print(LoRa_Receive_Data.tempC); Serial.print(" | "); Serial.println(LoRa_Receive_Data.Pulse_Count); }
/*
// read packet
while (LoRa.available()) {
Serial.print((char)LoRa.read());
}
*/
// print RSSI of packet
Serial.print("with RSSI ");
Serial.println(LoRa.packetRssi());
}
} -
RE: Core2 and M5Unified display no longer works
@felmue
Well, strange behaviour is not seldomly caused by strange root causes.
I already explained that after upload, the program seems to be running normal, only the screen stays dark.
After a lot of trial and error, it seems that it is to do with how the software is uploaded. We are using CH9102 or CP210x (not even sure which one). But the reality is that after uploading, poweing off the Core2, the screen seems to function normal. This is repeated behaviour detected with several M5Core2. Probably we need to upgrade one of the driver. Still hesitating about that because on OSX upgrading can be a risky business. Anyway, it appears to be solved (dont understand it btw).
Regards -
RE: Core2 and M5Unified display no longer works
@HappyUser
Further research
Tried the default M5GFX Bargraph example (attached)
No display on M5Stick and M5COre2
Works perfect on M5StickCPlus and M5CoreS3This is realy weird.
I hope someone can help#include <arduino.h> #include <M5GFX.h> M5GFX display; //#include <M5UnitOLED.h> //M5UnitOLED display; // default setting //M5UnitOLED display ( 21, 22, 400000 ); // SDA, SCL, FREQ //#include <M5UnitLCD.h> //M5UnitLCD display; // default setting //M5UnitLCD display ( 21, 22, 400000 ); // SDA, SCL, FREQ //#include <M5UnitGLASS2.h> //M5UnitGLASS2 display; // default setting //M5UnitGLASS2 display ( 21, 22, 400000 ); // SDA, SCL, FREQ // #include <M5AtomDisplay.h> // M5AtomDisplay display; static constexpr size_t BAR_COUNT = 64; static int max_y[BAR_COUNT]; static int prev_y[BAR_COUNT]; static uint32_t colors[BAR_COUNT]; void setup(void) { display.init(); display.startWrite(); display.fillScreen(TFT_BLACK); if (display.isEPD()) { display.setEpdMode(epd_mode_t::epd_fastest); } if (display.width() < display.height()) { display.setRotation(display.getRotation() ^ 1); } for (int x = 0; x < BAR_COUNT; ++x) { prev_y[x] = display.height(); max_y[x] = display.height(); int r=0,g=0,b=0; switch (x >> 4) { case 0: b = 255; g = x*0x11; break; case 1: b = 255 - (x&15)*0x11; g = 255; break; case 2: g = 255; r = (x&15)*0x11; break; case 3: r = 255; g = 255 - (x&15)*0x11; break; } colors[x] = display.color888(r,g,b); } } void loop(void) { int h = display.height(); static int i; ++i; display.waitDisplay(); for (int x = 0; x < BAR_COUNT; ++x) { int y = (h>>1) - (sinf((float)((x-24)*i) / 3210.0f) + sinf((float)((x-40)*i) / 1234.0f)) * (h>>2); int xpos = x * display.width() / BAR_COUNT; int w = ((x+1) * display.width() / BAR_COUNT) - xpos - 1; if (max_y[x]+1 >= y) { max_y[x] = y-1; } else { if ((i & 3) ==0 ) { display.fillRect(xpos, max_y[x]-3, w, 1, TFT_BLACK); max_y[x]++; } } display.fillRect(xpos, max_y[x]-3, w, 3, TFT_WHITE); if (prev_y[x] < y) { display.fillRect(xpos, prev_y[x], w, y - prev_y[x], TFT_BLACK); } else { display.fillRect(xpos, y, w, prev_y[x] - y, colors[x]); } prev_y[x] = y; } display.display(); }
-
RE: Core2 and M5Unified display no longer works
@felmue said in Core2 and M5Unified display no longer works:
Arduino library v3.2.1,
Dear all.
Thanks
@Felix : what do you exactly mean with Arduino library v3.2.1,?
My settings:
Arduino IDE 2.3.6
M5GFX : 0.2.13
M5Unified 0.2.8
Arduino ESP32 Boards 2.0.18M5Core2 display stays black. I have tried the same software on an M5Stick. Display also stays Black,
Software is running. Serial.print also shows the correct display dimensions.
Tried the software on a M5CoreS3 and the display is responding!!
Tried the software in M5Core2 AWS link text. and the display is responding!So apparantly for the M5Core2 and M5Stick I am missing something. M5CoreS3 works like expected?
Anyone a clue?
I am really grateful.(*As i noticed that the height and widt of the screen are correcty read and the buttons appear to be working, could it be that the backlight is just off?. Mind you, i have ttried on several devices so it is not a failure of one device *)
-
RE: Trying to compile Core example from M5Stack github
@teastain
Arduino/libraries/M5Stack/src/utility/pngle.c:31:10: fatal error: rom/miniz.h: No such file or directory
31 | #include <rom/miniz.h>Change in pngle.c into include <miniz.h> maybe?
Regards -
Core2 and M5Unified display no longer works
Wow,
I have uploaded the standard M5Unified Button code to my M5Core2.
I know the program is running because my serial.print shows button counts.
But the display shows nothing.
I have tried this on multiple Core2 of which I know the display is not defect. All boards and libs are updated (as fwr as i know).
What am i doing wrong here?
Thanks#include <M5Unified.h> void setup(void) { M5.begin(); Serial.begin(115200); /// For models with EPD : refresh control M5.Display.setEpdMode(epd_mode_t::epd_fastest); // fastest but very-low quality. if (M5.Display.width() < M5.Display.height()) { /// Landscape mode. M5.Display.setRotation(M5.Display.getRotation() ^ 1); } } void loop(void) { M5.delay(1); M5.update(); //------------------- Button test /* /// List of available buttons: M5Stack BASIC/GRAY/GO/FIRE: BtnA,BtnB,BtnC M5Stack Core2: BtnA,BtnB,BtnC,BtnPWR M5Stick C/CPlus: BtnA,BtnB, BtnPWR M5Stick CoreInk: BtnA,BtnB,BtnC,BtnPWR,BtnEXT M5Paper: BtnA,BtnB,BtnC M5Station: BtnA,BtnB,BtnC,BtnPWR M5Tough: BtnPWR M5Atom M5AtomU: BtnA M5Stamp Pico/C3/C3U: BtnA */ static constexpr const int colors[] = { TFT_WHITE, TFT_CYAN, TFT_RED, TFT_YELLOW, TFT_BLUE, TFT_GREEN }; static constexpr const char* const names[] = { "none", "wasHold", "wasClicked", "wasPressed", "wasReleased", "wasDeciedCount" }; int w = M5.Display.width() / 5; int h = M5.Display.height(); M5.Display.startWrite(); /// BtnPWR: "wasClicked"/"wasHold" can be use. /// BtnPWR of CoreInk: "isPressed"/"wasPressed"/"isReleased"/"wasReleased"/"wasClicked"/"wasHold"/"isHolding" can be use. int state = M5.BtnPWR.wasHold() ? 1 : M5.BtnPWR.wasClicked() ? 2 : M5.BtnPWR.wasPressed() ? 3 : M5.BtnPWR.wasReleased() ? 4 : M5.BtnPWR.wasDecideClickCount() ? 5 : 0; if (state) { M5_LOGI("BtnPWR:%s count:%d", names[state], M5.BtnPWR.getClickCount()); M5.Display.fillRect(w*0, 0, w-1, h, colors[state]); } /// BtnA,BtnB,BtnC,BtnEXT: "isPressed"/"wasPressed"/"isReleased"/"wasReleased"/"wasClicked"/"wasHold"/"isHolding" can be use. state = M5.BtnA.wasHold() ? 1 : M5.BtnA.wasClicked() ? 2 : M5.BtnA.wasPressed() ? 3 : M5.BtnA.wasReleased() ? 4 : M5.BtnA.wasDecideClickCount() ? 5 : 0; if (state) { M5_LOGI("BtnA:%s count:%d", names[state], M5.BtnA.getClickCount()); M5.Display.fillRect(w*1, 0, w-1, h, colors[state]); Serial.println(M5.BtnA.getClickCount()); } state = M5.BtnB.wasHold() ? 1 : M5.BtnB.wasClicked() ? 2 : M5.BtnB.wasPressed() ? 3 : M5.BtnB.wasReleased() ? 4 : M5.BtnB.wasDecideClickCount() ? 5 : 0; if (state) { M5_LOGI("BtnB:%s count:%d", names[state], M5.BtnB.getClickCount()); M5.Display.fillRect(w*2, 0, w-1, h, colors[state]); } state = M5.BtnC.wasHold() ? 1 : M5.BtnC.wasClicked() ? 2 : M5.BtnC.wasPressed() ? 3 : M5.BtnC.wasReleased() ? 4 : M5.BtnC.wasDecideClickCount() ? 5 : 0; if (state) { M5_LOGI("BtnC:%s count:%d", names[state], M5.BtnC.getClickCount()); M5.Display.fillRect(w*3, 0, w-1, h, colors[state]); } state = M5.BtnEXT.wasHold() ? 1 : M5.BtnEXT.wasClicked() ? 2 : M5.BtnEXT.wasPressed() ? 3 : M5.BtnEXT.wasReleased() ? 4 : M5.BtnEXT.wasDecideClickCount() ? 5 : 0; if (state) { M5_LOGI("BtnEXT:%s count:%d", names[state], M5.BtnEXT.getClickCount()); M5.Display.fillRect(w*4, 0, w-1, h, colors[state]); } M5.Display.endWrite(); } #if !defined ( ARDUINO ) && defined ( ESP_PLATFORM ) extern "C" { void loopTask(void*) { setup(); for (;;) { loop(); } vTaskDelete(NULL); } void app_main() { xTaskCreatePinnedToCore(loopTask, "loopTask", 8192, NULL, 1, NULL, 1); } } #endif
-
8-Channel Servo Driver Unit to drive a 5 volt DC motor
Hi,
I was wondering, can i use the 8-Channel Servo Driver Unit (STM32F030) to directly PWM control a 5 volt DC motor?
Any thoughts ?Thanks
HappyUser