Thanks guys adding the build flags fixed the blank serial terminal in PlatformIO.
Latest posts made by LukeS
-
RE: Anyone using PlatformIO? Unable to get serial terminal to work.
-
Anyone using PlatformIO? Unable to get serial terminal to work.
Does anyone here use platform IO? I am unable to get the serial monitor to see what I print to the serial monitor. Anyone else have this issue?
Main.cpp
#include <Arduino.h> #include <M5Unified.h> int counter1 = 0; void setup() { auto cfg = M5.config(); M5.begin(cfg); delay(500); M5.Display.setTextSize(2); } void loop() { M5.update(); M5.Display.setCursor(0, 20); M5.Display.print("C1: "); M5.Display.print(counter1); Serial.println(counter1); delay(200); counter1++; }
Platform.ini
[env:m5stack-atoms3] platform = espressif32 board = m5stack-atoms3 framework = arduino monitor_speed = 115200 monitor_rts = 0 monitor_dtr = 0 monitor_raw = yes lib_deps = m5stack/M5Unified@^0.1.13
-
C++ syntax question - Defining an object in a class that requires arguments?
I need some help with how to properly define an object in a class as a public object of the class for objects that require arguments. I would like to hardcode the arguments. For example I want to make the second UART port in a class and hardcode the UART to 2.
.h file for class
#ifndef TestClass_h #define TestClass_h #include "Arduino.h" #include <M5Unified.h> class TestClass { public: //-- Define RS458 to UART to UART2, HardwareSerial needs a UART number passed to it -- //What I have tried, I would like to hardcode the UART number to 2. How do I do this????? HardwareSerial SerialRS485; // 1 - Does not compile, I need something in the .cpp file to make this work HardwareSerial SerialRS485(uint8_t _uart); // 2 - Can get this to compile but then does not compile if I use a uncomment the test funciton HardwareSerial SerialRS485(uint8_t 2); // 3 - Does not compile //constructor TestClass(); //Functions - Main void testFunction(); private: uint16_t _private1 = 0; }; #endif
.cpp file for class
#include "TestClass.h" #include "Arduino.h" //Constructor def TestClass::TestClass() { } void TestClass::testFunction() { Serial.println("USB Serial Port"); SerialRS485.println("RS485 Serial Port"); }
main ino file
#include "Arduino.h" #include <M5Unified.h> //For M5Stack ESP Hardware //Create test class #include "TestClass.h" TestClass TestObject; void setup(void) { auto cfg = M5.config(); //M5 Unified config M5.begin(cfg); delay(500); } void loop(void) { M5.update(); //Update button state TestObject.testFunction(); delay(1000); }
-
AtomS3 & AtomS3Lite Schematic?
Where can I find a schematic of the AtomS3 & AtomS3 Lite? The Atom Lite has a schematic on the product page which is extremely helpful
-
RE: M5 RS485 Modbus slave sample code does not compile
@ajb2k3 yup, all the libraries in the include section are downloaded and the compiler does not throw any missing file errors
-
M5 RS485 Modbus slave sample code does not compile
I have an Atom Switch that I want to use RS485 modbus with has not modbus sample code. So I trying to use sample code from the ATOM DTU devices.
When I try to compile the sample code it gives the following error
error: no matching function for call to 'RS485Class::RS485Class(HardwareSerial&, int, int, int, int)' RS485Class RS485(Serial2, ATOM_DTU_RS485_RX, ATOM_DTU_RS485_TX, -1, -1);
Which makes sense as I don't understand where the RS485Class is defined or how it is in the below code sample. Has anyone got this working?
#include <M5Atom.h> #include <ArduinoModbus.h> #include <ArduinoRS485.h> #include "ATOM_DTU_NB.h" const int numCoils = 10; const int numDiscreteInputs = 10; const int numHoldingRegisters = 10; const int numInputRegisters = 10; RS485Class RS485(Serial2, ATOM_DTU_RS485_RX, ATOM_DTU_RS485_TX, -1, -1);
-
Atom LED and serial port (not USB) on Atom Switch Kit with M5Unified
I don't know where to find good documentation on the M5Unified Arduino code to find what function calls are needed. I have an atom switch kit. I am trying to write code with the new M5Unified but I don't know how to set the LED color. The sample code I have is this sample code but the LED code does not work in M5Unified.
Does the Atom serial port connected to the RS485 chip in the Atom Switch Kit and other Atom RS485 boards have a FIFO or is it all software bit banged on the Atom Lite (RX G33 & TX G23) and AtomS3 (RX G8 & TX G7)?
-
ATOM Lite esp32-pico-d4 5V tolerant inputs?
The ATOM Lite has a 5V output for the GROVE port but the esp32-pico-d4 uC datasheet says the max digitals high level input is VDD+0.3. The ATOM Lite is powering the ESP32 with 3.3V so that means the max voltage on the i2c SCL & SCA pins would be 3.6V.
Why does the ESP32 output 5V on the GROVE port it if can't accept 5V digital inputs. Do all i2c devices require their own 5V -> 3.3V step down converter then?
-
Sample code from M5 Github does not work on AtomS3 in Arudino IDE
I am unable to get the LED Show example for the AtomS3 to compile, well any of the examples for that use the serial port. I followed these instructions. I am running Arduino IDE 2.2.1 on windows 11 with the M5 Stack library and the M5AtomS3 board selected in the IDE. Looks like it cannot find the definition of USBSerial as the error states "Compilation error: 'USBSerial' was not declared in this scope"
In file included from c:\Users\Luke\OneDrive - Luke\Documents\Arduino\libraries\FastLED\src/FastLED.h:75, from c:\Users\Luke\OneDrive - Luke\Documents\Arduino\libraries\M5AtomS3\src/M5AtomS3.h:8, from C:\Users\Luke\AppData\Local\Temp\.arduinoIDE-unsaved2023109-47808-1drqtel.cea6\sketch_nov9a\sketch_nov9a.ino:15: c:\Users\Luke\OneDrive - Luke\Documents\Arduino\libraries\FastLED\src/fastspi.h:157:23: note: #pragma message: No hardware SPI pins defined. All SPI access will default to bitbanged output # pragma message "No hardware SPI pins defined. All SPI access will default to bitbanged output" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:\Users\Luke\AppData\Local\Temp\.arduinoIDE-unsaved2023109-47808-1drqtel.cea6\sketch_nov9a\sketch_nov9a.ino: In function 'void setup()': C:\Users\Luke\AppData\Local\Temp\.arduinoIDE-unsaved2023109-47808-1drqtel.cea6\sketch_nov9a\sketch_nov9a.ino:23:5: error: 'USBSerial' was not declared in this scope USBSerial.println("Pls Press Btn change color"); ^~~~~~~~~ C:\Users\Luke\AppData\Local\Temp\.arduinoIDE-unsaved2023109-47808-1drqtel.cea6\sketch_nov9a\sketch_nov9a.ino:23:5: note: suggested alternative: 'Serial' USBSerial.println("Pls Press Btn change color"); ^~~~~~~~~ Serial exit status 1 Compilation error: 'USBSerial' was not declared in this scope