I think I may have found my answer in the RS485 hat lib: https://github.com/m5stack/M5StickC/blob/master/examples/Hat/RS485/RS485.ino
Latest posts made by klimbot
-
RE: Serial2 on M5StickC
-
RE: Serial2 on M5StickC
@chriswr thanks for the suggestion, but still no luck.
I've gone back to basics and tried to do a loopback test but can't even get that working! Will look further in to the manuals and see if there is any restriction on pins used for UART.
Out of interest, can anyone tell me if the pin numbers quoted on the GitHub page for the M5StickC are the actual pin numbers we are supposed to use in the Arduino environment? Or do the GPIO numbers need to be converted to pin numbers?
Thanks
-
Serial2 on M5StickC
Has anyone been able to get Serial2 working on the M5StickC?
I've tried all that I can think of but I'm stuck.I'm trying to use the hat pins at the top of the board, and from what I've read the ESP32 has the ability to assign almost any function to a particular pin. In my case I wanted to use pins 26 and 36 for TX and RX.
I've tried a few different things including:
- Using pins 36, 26 in setup
- Using pins 5 and 15 in setup (based on this diagram I thought the pins might have been wrong)
- Switched to just trying digitalWrite on the pins and looking for a result.
My setup is:
- M5StickC connected via USB to laptop - COM6
- USB to serial device (jumper set to 3.3v) - COM7
#include <M5StickC.h> void setup() { // Setup the TFT display M5.begin(); // Setup the serial port for debugging Serial.begin(115200); Serial.println(); Serial.println("Ready."); //Serial2.begin(115200, SERIAL_8N1, 26, 36); //Serial2.println("Testing Serial2"); pinMode(5, OUTPUT); pinMode(15, OUTPUT); } void loop() { //Serial2.print("Testing Serial2: "); //Serial2.println(millis()); digitalWrite(5, HIGH); digitalWrite(15, HIGH); delay(10); digitalWrite(5, LOW); digitalWrite(15, LOW); }
Any thoughts?
-
RE: M5StickC: turn off screen completely
@dda said in M5StickC: turn off screen completely:
I did a simple test: with only REG 28H the screen stays slightly warm. With both 28H and 10H, the screen cools off after a while. Hardly a scientific test, I know, but seems to point to the need to set both registers.
I'm looking at this thread to hopefully implement a complete screen turn off, but am not sure what register mask to use (based on quoted post)
Here is what I have, the screen is off but hard to know if the screen has actually been disabled.
void turnOffScreen() {
Wire1.beginTransmission(0x34);
Wire1.write(0x10);
Wire1.write(0b00000000); // 7-3=? | 2=EXTEN | 1=? | 0=DC-DC2
Wire1.endTransmission();Wire1.begin(21, 22);
Wire1.beginTransmission(0x34);
Wire1.write(0x12);
Wire1.write(0b01001011); // 7=? | 6=EXTEN | 5=? | 4=DC-DC2 | 3=LDO3 | 2=LDO2 | 1=DC-DC3 | 0=DC-DC1
Wire1.endTransmission();Wire1.beginTransmission(0x34);
Wire1.write(0x28);
Wire1.write(0b00001111); // 7-4=LDO2 | 3-0=LDO3
Wire1.endTransmission();
} -
RE: New member checking to see that the M5Stack is suited to my projects.
@gilow once my device was programmed and hooked up to a decent power source I've had no issues. For example I've been running an EPS8266 with a very basic Blynk sketch for a couple of years, only time I noticed it went down was when they changed something on their end and the device could no longer connect.
The instability I was talking about was manly around using libraries that read and wrote from flash (WiFi setup and credential storage) but again that seems to have gotten a lot better lately with more recent updates of the Arduino library.
-
RE: New member checking to see that the M5Stack is suited to my projects.
@Gilow I was going to suggest exactly what you said about the external module if you aren't sure of accuracy of built-in device. Seems like the best option.
I'm still waiting for my M5StickC so can't really comment on the M5 device, but in my experience with ESP8266 and ESP32 in general I have found stability to be an issue compared with more conventional micros. Disclaimer: I've only ever used the Arduino environment.
I've noticed a significant improvement in stability over the last 12 months, but a while back I've found myself in situations where positioning of debug/print statements would cause stability/instability.
Sounds like a cool project, looking forward to seeing more.
-
RE: Max 5v current out
Awesome, thanks for sharing @wikistik!!
Will take this in to account when designing my hat. -
Max 5v current out
Hi,
I'm looking to make my own hat for my M5StickC and was looking to find the max current out available at 5v. Any ideas?
Thanks.