on Arduino, You are try something like this??:
Serial1.begin(115200, SERIAL_8N1, 32, 26);
pin32 and pin26 on grove connector as RX and TX
I haven't tested it...
on Arduino, You are try something like this??:
Serial1.begin(115200, SERIAL_8N1, 32, 26);
pin32 and pin26 on grove connector as RX and TX
I haven't tested it...
I received M5StickC yesterday and I noticed a problem with the display in my M5Stick-C,
but additionally my Stick is completely unusable because the reset button is broken!
It did not work like the other buttons (with a characteristic click). I unscrewed the case and the parts of the button have come out.
Unfortunately I'm not happy with the winning.
How can I open the rest of the plate to replace the button? Is it possible?
I wrote to you in this case on the aliexpress.
what is your screen orientation? landscape or portrait ??
where is your text?
try to swap values 160 with 120 for portrait mode
or use this instead:
M5.Lcd.drawString("M5Stack has been connected", (int)(M5.Lcd.width()/2), (int)(M5.Lcd.height()/2), 2);
which calculates values for current orientation.
I do not have hw for tests
For safe use in the future, better way is:
void Display_WiFi_Connected() {
M5.Lcd.clear(BLACK);
M5.Lcd.setTextDatum(CC_DATUM);
M5.Lcd.drawString("M5Stack has been connected", 160, 120, 2);
}
because drawCentreString is marked as deprecated
use:
setTextDatum(uint8_t datum);
https://github.com/m5stack/M5Stack/blob/master/src/utility/In_eSPI.h#L554
and available options:
https://github.com/m5stack/M5Stack/blob/master/src/utility/In_eSPI.h#L331
Phisically connect Your MAX to SPI lines and CS leave connected as is!
M5Stack pinout:
https://github.com/m5stack/M5Stack#pinout
MAX DO -> M5Stack MISO (GPIO19)
MAX CS -> M5Stack GPIO17
MAX CLK -> M5Stack CLK (GPIO18)
Looks like You have connection prepared corectly...
Change only Your sketch like this:
#include <SPI.h>
#include <Adafruit_MAX31855.h>
//#include <M5Stack.h>
// Example creating a thermocouple instance with software SPI on any three digital IO pins.
//#define MAXDO 19
//#define MAXCLK 18
#define MAXCS 17
Adafruit_MAX31855 thermocouple(MAXCS);
void setup() {
//M5.begin();
Serial.begin(115200);
Serial.print("Internal Temp = ");
Serial.println(thermocouple.readInternal());
while (!Serial) delay(1); // wait for Serial on Leonardo/Zero, etc
Serial.println("MAX31855 test");
thermocouple.begin();
// wait for MAX chip to stabilize
delay(2000);
}
void loop() {
// basic readout test, just print the current temp
Serial.print("Internal Temp = ");
Serial.println(thermocouple.readInternal());
double c = thermocouple.readCelsius();
if (isnan(c)) {
Serial.println("Something wrong with thermocouple!");
} else {
Serial.print("C = ");
Serial.println(c);
}
delay(1000);
//M5.update();
}
@sibtcha , try to initialize Adafruit_MAX31855 library only with CS pin:
Adafruit_MAX31855 thermocouple(MAXCS);
as You see at library source: https://github.com/adafruit/Adafruit-MAX31855-library/blob/master/Adafruit_MAX31855.cpp
when You declare SPI CLK line then library try read this device by software SPI implementation!
also You are forgot thermocouple.begin();
Finally we can choose partition scheme for M5Stack board in Arduino IDE.
It means that for large application (for eg. with bluetooth stack),
that exceededs the maximum flash size for the default partition scheme,
we can choose two others partitons "no ota" or "minimal spiffs".
https://github.com/espressif/arduino-esp32/pull/1382
https://github.com/espressif/arduino-esp32/pull/1302
maximum sketch size for partitions:
1310720 -> default
2097152 -> no_ota
1966080 -> min_spiffs
Names on the right side correspond to the GPIO numbers on the left and are connected together.
higher DA mean GPIO25
lower DA mean GPIO26
R0/T0 = GPIO3/GPIO1 -> uart0
R2/T2 = GPIO16/GPIO17 -> uart2
Similarly, bottom names applies to the gpio numbers at the top.