simple app Accu meter (MAX17043 module soldered inside Battery Module):
code based on nlamprian library from https://github.com/nlamprian/LiFuelGauge:
available on my gist:
https://gist.github.com/reaper7/c9f8dba68edae8c3d53075b10f6bbba4
simple app Accu meter (MAX17043 module soldered inside Battery Module):
code based on nlamprian library from https://github.com/nlamprian/LiFuelGauge:
available on my gist:
https://gist.github.com/reaper7/c9f8dba68edae8c3d53075b10f6bbba4
@dda 在 Let's speed up DrawLine and DrawPixel? 中说:
Yep. And I managed to integrate this to the M5Stack library. I am doing tests, but so far so good. I've run a few modified sketches without issue. The TFT_ArcFill example is quite impressive.
.
.
.
There may be others, I'll see what happens when I compile the non-touch examples.
TFT_eSPI is the best lib, we added m5stack support some time ago:
https://github.com/Bodmer/TFT_eSPI/pull/88
btw, m5stack display lib based on the early version of TFT_eSPI
but since then, TFT_eSPI has developed a LOT!!!
P.S. for advanced GUI we also added m5stack support for GUIslice:
https://github.com/ImpulseAdventure/GUIslice/pull/34
which uses TFT_eSPI as display driver.
Accu meter app (MAX17043 module soldered inside Battery Module)
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.
@m5stack - very good news!
P.S. please also check the quality of connectors, especially female (on master board),
maybe only my m5stack has such a problem but from the beginning of use, various pins have a contact problem
with bottom plates(I check different: ioExtension/proto board/battery board).
Evidently male pins from bottom plates do not have good contact with female connector on base plate, I do not check all contacts but have problem with accu pin, adc35 pin, adc36 pin.
it's very annoying and spoils the positive impression from the module
when you can not read the input status and wonder what is wrong in the code
and it's not the fault of the code but the lack of contact
P.S.P.S please also vote for this PR: https://github.com/espressif/arduino-esp32/pull/1242
because current version of board.txt do not include proper pins_arduino.h variant for m5stack and for e.g. ADC1 or ADC2 are unknown when compile
cutting pcb is not necessary,
cutting wire between ACCU+ and VCC also not necessary
but I do not want drain accu by max17043 when m5stack is off
REMEMBER! If wire between ACCU+ and VCC are not cut (on the max17043 pcb) as it is originally,
then connect only ACCU+ pin to M-BUS BATTERY and DO NOT connect VCC to M-BUS 3.3V
Hi @JimiT ,
Of course You can copy/clone/improve, this is for the people :)
About finally sketch size...there are two options:
Personally I use a second option to keep up with git changes.
BTW choose the partition size should be available in ide.
About sd loader...great idea! I didn't know this library, tnx for link!
from http://desire.giesecke.tk/index.php/2018/01/30/change-partition-size/
inside ..esp32\tools\partitions add new file for e.g. bigapp.csv with content:
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x1E0000,
app1, app, ota_1, 0x1F0000,0x1E0000,
eeprom, data, 0x99, 0x3F0000,0x1000,
spiffs, data, spiffs, 0x3F1000,0xF000,
and inside esp32\boards.txt add new(copy) board like:
##############################################################
m5stack_bigapp.name=M5Stack_bigapp
m5stack_bigapp.upload.tool=esptool
m5stack_bigapp.upload.maximum_size=1966080
m5stack_bigapp.upload.maximum_data_size=294912
m5stack_bigapp.upload.wait_for_upload_port=true
m5stack_bigapp.serial.disableDTR=true
m5stack_bigapp.serial.disableRTS=true
m5stack_bigapp.build.mcu=esp32
m5stack_bigapp.build.core=esp32
m5stack_bigapp.build.variant=esp32
m5stack_bigapp.build.board=M5Stack_bigapp
m5stack_bigapp.build.f_cpu=240000000L
m5stack_bigapp.build.flash_size=4MB
m5stack_bigapp.build.flash_mode=dio
m5stack_bigapp.build.boot=dio
m5stack_bigapp.build.partitions=bigapp
m5stack_bigapp.menu.FlashMode.qio=QIO
m5stack_bigapp.menu.FlashMode.qio.build.flash_mode=dio
m5stack_bigapp.menu.FlashMode.qio.build.boot=qio
m5stack_bigapp.menu.FlashMode.dio=DIO
m5stack_bigapp.menu.FlashMode.dio.build.flash_mode=dio
m5stack_bigapp.menu.FlashMode.dio.build.boot=dio
m5stack_bigapp.menu.FlashMode.qout=QOUT
m5stack_bigapp.menu.FlashMode.qout.build.flash_mode=dout
m5stack_bigapp.menu.FlashMode.qout.build.boot=qout
m5stack_bigapp.menu.FlashMode.dout=DOUT
m5stack_bigapp.menu.FlashMode.dout.build.flash_mode=dout
m5stack_bigapp.menu.FlashMode.dout.build.boot=dout
m5stack_bigapp.menu.FlashFreq.80=80MHz
m5stack_bigapp.menu.FlashFreq.80.build.flash_freq=80m
m5stack_bigapp.menu.FlashFreq.40=40MHz
m5stack_bigapp.menu.FlashFreq.40.build.flash_freq=40m
m5stack_bigapp.menu.UploadSpeed.921600=921600
m5stack_bigapp.menu.UploadSpeed.921600.upload.speed=921600
m5stack_bigapp.menu.UploadSpeed.115200=115200
m5stack_bigapp.menu.UploadSpeed.115200.upload.speed=115200
m5stack_bigapp.menu.UploadSpeed.256000.windows=256000
m5stack_bigapp.menu.UploadSpeed.256000.upload.speed=256000
m5stack_bigapp.menu.UploadSpeed.230400.windows.upload.speed=256000
m5stack_bigapp.menu.UploadSpeed.230400=230400
m5stack_bigapp.menu.UploadSpeed.230400.upload.speed=230400
m5stack_bigapp.menu.UploadSpeed.460800.linux=460800
m5stack_bigapp.menu.UploadSpeed.460800.macosx=460800
m5stack_bigapp.menu.UploadSpeed.460800.upload.speed=460800
m5stack_bigapp.menu.UploadSpeed.512000.windows=512000
m5stack_bigapp.menu.UploadSpeed.512000.upload.speed=512000
m5stack_bigapp.menu.DebugLevel.none=None
m5stack_bigapp.menu.DebugLevel.none.build.code_debug=0
m5stack_bigapp.menu.DebugLevel.error=Error
m5stack_bigapp.menu.DebugLevel.error.build.code_debug=1
m5stack_bigapp.menu.DebugLevel.warn=Warn
m5stack_bigapp.menu.DebugLevel.warn.build.code_debug=2
m5stack_bigapp.menu.DebugLevel.info=Info
m5stack_bigapp.menu.DebugLevel.info.build.code_debug=3
m5stack_bigapp.menu.DebugLevel.debug=Debug
m5stack_bigapp.menu.DebugLevel.debug.build.code_debug=4
m5stack_bigapp.menu.DebugLevel.verbose=Verbose
m5stack_bigapp.menu.DebugLevel.verbose.build.code_debug=5
##############################################################
then for your big apps you can select this board
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
@tomsuch 在 M5Stack - Simple Applications Menu + some APPs 中说:
APP - GY-512
very nice system!
APP - GY-512 works also with built-in MPU9250 :)
Can You modify TIM MEASUREMENT APP?
S/S button should 1.START->2.STOP->3.START without reset between 2 and 3 step...(something like continous measurement with pause). For reset value we have RES button
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...
@vvs551 在 Battery issue 中说:
I have the same problem, I think.
There is absent +5V at the bottom board.
But, when I press the bottom to main board with a great force, this problem is out.
As for me, there is a bad contact on the connector between mainboard and bottom.
And I don't know how to fix it ((
I have similar obeservations...
Solved this by a little deflection all header pins on bottom board
but it looks like it's a base plate female header problem, not bottom male header,
because when I got battery board then problem back and in this board I also had little move header pins
something like this: from IIIII to IIIII
why no?
we have CAN library:
for esp-idf:
https://github.com/ThomasBarth/ESP32-CAN-Driver
for arduino:
https://github.com/nhatuan84/arduino-esp32-can-demo
more info:
http://www.iotsharing.com/2017/09/how-to-use-arduino-esp32-can-interface.html
we only need additional CAN transceiver as described above
we still can use GPIO35 as CAN RX and GPIO5 as CAN TX (this config is used by Olimex EVB Rev B)
Personally I haven't tested GPIOs pair 35/5 but pair 4/5 works very well with arduino lib
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();
}