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 includedposted in PRODUCTS
-
Atom Echo. Format and create sound fileposted in Atom
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)posted in Modules
@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 sheetposted in General
@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 503posted in Atom
@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: STAMP CATM does not respond (Solved, HTML Get and Send Email)posted in Modules
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 passworddelay(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: SIM7080G CAT-M/NB-IoT+GNSS Unit Issuesposted in Units
#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;
}
} -
Core2 and M5Unified display no longer worksposted in Core 2
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 -
RE: STAMP-C3 problem with Serial2posted in Modules
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: Remote Sensing with Core2 (UIFlow) via LORA Point-to-pointposted in Units
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.
Latest posts made by HappyUser
-
RE: M5Unit C6L Lora initialisation errorposted in Units
@HappyUser
These are the libs that I am using. Could it be that somehow there is a difference with your config?
Multiple libraries were found for "SPI.h"
Used: /Users/..../Library/Arduino15/packages/m5stack/hardware/esp32/3.2.5/libraries/SPI
Not used: /Users/....../Library/Arduino15/packages/m5stack/hardware/esp32/3.2.5/libraries/_DontUse_SPI
Using library RadioLib at version 7.3.0 in folder: /Users/....../Documents/Arduino/libraries/RadioLib
Using library SPI at version 3.2.1 in folder: /Users....../Library/Arduino15/packages/m5stack/hardware/esp32/3.2.5/libraries/SPI
Using library M5Unified at version 0.2.13 in folder: /Users/....../Documents/Arduino/libraries/M5Unified
Using library M5GFX at version 0.2.15 in folder: /Users.../Documents/Arduino/libraries/M5GFX
/Users/....../Library/Arduino15/packages/m5stack/tools/esp-rv32/2411/bin/riscv32-esp-elf-size -A /Users/..../Library/Caches/arduino/sketches/E220783385D73AB555D51793968410FB/LoRa_Test.ino.elf
Sketch uses 434305 bytes (33%) of program storage space. Maximum is 1310720 bytes.
Global variables use 17508 bytes (5%) of dynamic memory, leaving 310172 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.8.1
Serial port /dev/cu.usbmodem1101:
Connecting...
Connected to ESP32-C6 on /dev/cu.usbmodem1101:
Chip type: ESP32-C6 (QFN40) (revision v0.2)
Features: Wi-Fi 6, BT 5 (LE), IEEE802.15.4, Single Core + LP Core, 160MHz
Crystal frequency: 40MHz
USB mode: USB-Serial/JTAG
MAC: 58:8c:81:ff:fe:50:00:08
BASE MAC: 58:8c:81:50:00:08
MAC_EXT: ff:fe -
RE: M5Unit C6L Lora initialisation errorposted in Units
@felmue Thank you. I tried this extra spi call because I assumed that something is wrong with SPI. Leaving out this call does not solve the problem either. Bot M5Unified and and radiolib are updated. M5Stack board manager is also updated. This is very weird. Not sure how to process further.
-
RE: M5Unit C6L Lora initialisation errorposted in Units
I receive this debug error message : GPIO pre-transfer timeout, is it connected? which is located in in the function
int16_t Module::SPItransferStream(const uint8_t* cmd, uint8_t cmdLen, bool write, const uint8_t* dataOut, uint8_t* dataIn, size_t numBytes, bool waitForGpio)
in the file Module.cppI am using the example in this M5Stack link : https://docs.m5stack.com/en/arduino/unit_c6l/lora
Help is appreciated.
Regards -
M5Unit C6L Lora initialisation errorposted in Units
Hi, I am using the following program to test Lora on this model. However, i receive this error: [SX1262] Initializing... Failed, code: -2. I assume that i am using the correct ports as given in rthe documentation. Any suggestions ? Thanks ```
#include <RadioLib.h>
//#include <arduino.h>
#include <M5Unified.h>
#include <SPI.h>// SX1262: CS, IRQ, NRST, BUSY
SX1262 radio = new Module(23, 7, RADIOLIB_NC, 19);bool receiveFlag = false; // flag to indicate that a packet was received
// function to be called when a complete packet is received
void setFlag(void) {
receiveFlag = true;
}#define LORA_MISO 22 //38 //19
#define LORA_MOSI 21 //23
#define LORA_SCLK 20 //18void setup() {
// auto cfg = M5.config();
// M5.begin(cfg);Serial.begin(115200);
M5.begin();
delay(1000);Serial.println("And we have started");
if (SPI.begin(LORA_SCLK, LORA_MISO, LORA_MOSI,-1)) // SCK, MISO, MOSI, SS { Serial.println("Fine"); M5.Display.print("SPI is fine"); } else { Serial.println("Not fine"); M5.Display.print("SPI ERROR"); }auto& ioe = M5.getIOExpander(0);
ioe.digitalWrite(7, false);
delay(100);
ioe.digitalWrite(7, true); // re-enable SX_NRST
ioe.digitalWrite(6, true); // enable SX_ANT_SW
ioe.digitalWrite(5, true); // enable SX_LNA_EN// initialize SX1262
Serial.print("\n[SX1262] Initializing... ");
// frequency MHz, bandwidth kHz, spreading factor, coding rate denominator, sync word,
// output power dBm, preamble length, TCXO reference voltage, useRegulatorLDO
int beginState = radio.begin(868.0, 125.0, 12, 5, 0x34, 22, 20, 3.0, true);
if (beginState == RADIOLIB_ERR_NONE) {
Serial.println("Succeeded!");
} else {
Serial.print("Failed, code: ");
Serial.println(beginState);
while (true) { delay(100); }
}// set the function to be called when a new packet is received
radio.setPacketReceivedAction(setFlag);// start listening for LoRa packets
Serial.print("[SX1262] Starting to listen... ");
int receiveState = radio.startReceive();
if (receiveState == RADIOLIB_ERR_NONE) {
Serial.println("Succeeded!");
} else {
Serial.print("Failed, code: ");
Serial.println(receiveState);
while (true) { delay(100); }
}
}void loop() {
if (receiveFlag) { // check if a new packet is received
receiveFlag = false; // reset the flagString str; // read the received data as an Arduino String int readState = radio.readData(str); if (readState == RADIOLIB_ERR_NONE) { // packet was received successfully Serial.println("\n[SX1262] Received packet!"); Serial.print("[SX1262] Data: "); Serial.println(str); Serial.print("[SX1262] RSSI: "); Serial.print(radio.getRSSI()); // Received Signal Strength Indicator Serial.println(" dBm"); Serial.print("[SX1262] SNR: "); Serial.print(radio.getSNR()); // Signal-to-Noise Ratio Serial.println(" dB"); Serial.print("[SX1262] Frequency error: "); Serial.print(radio.getFrequencyError()); Serial.println(" Hz"); } else if (readState == RADIOLIB_ERR_CRC_MISMATCH) { // packet was received but malformed Serial.println("CRC error!"); } else { // some other error occurred Serial.print("Failed, code: "); Serial.println(readState); }}
} -
Tab5, LVGL, trying to get touch workingposted in Cores
Solved: somehow commented the lv_tick_inc(5); in the main loop.
Hi, I m trying to get touch working together with lvgl 8.3. I believe the code is not working. Any suggestions? ```
#include <arduino.h>
#include <M5GFX.h>
#include <M5Unified.h>
#include <WiFi.h>
#include <WiFiClient.h>
#include <esp_now.h>
#include <lvgl.h>
#include <M5GFX.h>M5GFX display;
#define LVGL_LCD_BUF_SIZE (Screen_Width * Screen_Height)
// lvgl variables
static lv_disp_drv_t disp_drv;
static lv_disp_draw_buf_t draw_buf;
static lv_color_t *buf;// UI objects
lv_obj_t * screen;void lv_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p)
{
uint32_t w = (area->x2 - area->x1 + 1);
uint32_t h = (area->y2 - area->y1 + 1);
//M5.Display.pushImageDMA(area->x1, area->y1, w, h, (uint16_t *)&color_p->full);
display.pushImageDMA(area->x1, area->y1, w, h, (uint16_t *)&color_p->full);
lv_disp_flush_ready(disp);
}// touch callback
static void lv_indev_read(lv_indev_drv_t *indev_driver, lv_indev_data_t *data)
{
lgfx::touch_point_t tp[3];
// uint8_t touchpad = M5.Display.getTouchRaw(tp,3);
uint8_t touchpad = display.getTouchRaw(tp,3);
if (touchpad > 0)
{
data->state = LV_INDEV_STATE_PR;
data->point.x = tp[0].x;
data->point.y = tp[0].y;
Serial.printf("X: %d Y: %d\n", tp[0].x, tp[0].y); //for testing
}
else
{
data->state = LV_INDEV_STATE_REL;
}
}void setup() {
//auto cfg = M5.config();
//M5.begin(cfg);
//M5.Display.startWrite();
//M5.begin();
Serial.begin(115200);
delay(300);Serial.println("And we have started"); display.init(); lv_init(); buf = (lv_color_t *)heap_caps_malloc(sizeof(lv_color_t) * LVGL_LCD_BUF_SIZE, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT); lv_disp_draw_buf_init(&draw_buf, buf, NULL, LVGL_LCD_BUF_SIZE); // set up display driver lv_disp_drv_init(&disp_drv); disp_drv.hor_res = Screen_Width; disp_drv.ver_res = Screen_Height; disp_drv.flush_cb = lv_disp_flush; disp_drv.draw_buf = &draw_buf; disp_drv.sw_rotate = 1; disp_drv.rotated = LV_DISP_ROT_90; lv_disp_drv_register(&disp_drv); // initialise touch static lv_indev_drv_t indev_drv; lv_indev_drv_init(&indev_drv); indev_drv.type = LV_INDEV_TYPE_POINTER; indev_drv.read_cb = lv_indev_read; lv_indev_drv_register(&indev_drv);}
void loop() {
lv_timer_handler();
delay(5);}
-
RE: M5Atom Matrix, M5Unfied, controlling ledsposted in Atom
@felmue thanks. Indeed. Leaving out m5unified does the trick. Though I haven’t read anything about an incompatibility between M5Unified and FastLed. Regards.
-
M5Atom Matrix, M5Unfied, controlling ledsposted in Atom
Hi am stumped,
I just can't control the leds anymore.
This is my code, no led goes on.
Any suggestion where I am going terrible wrong?#include <arduino.h> #include <M5Unified.h> #include <FastLED.h> #define NUM_LEDS 25 #define DATA_PIN 27 #define CLOCK_PIN 13 CRGB leds[NUM_LEDS]; void setup() { auto cfg = M5.config(); cfg.serial_baudrate = 115200; cfg.output_power = true; M5.begin(cfg); //FastLED.addLeds<WS2812, DATA_PIN,GRB>(leds, NUM_LEDS); // GRB ordering is assumed FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS); for (int i=0;i<NUM_LEDS;i++) {leds[i]=CRGB::Red;};FastLED.show(); } -
RE: Tab 5, how to enable Lora?posted in PRODUCTS
@easytarget thank you. That is indeed an option. In my experience not to much work to get a Lora module working. We have a number of them in the field. But we would like the tab5 not become thicker as it is. We are now considering to place an Heltec Lora inside. Maybe that could work. Regards.
-
RE: Tab 5, how to enable Lora?posted in PRODUCTS
@felmue Thank you, that makes sense. Btw, a great product.
-
Tab 5, how to enable Lora?posted in PRODUCTS
It appears that the tab5 is prepared to work with Lora. Any idea how?
Thanks