Using M5 stack core with Arduino .How do I get regional fonts? I can't find the UK pound sign £
Posts made by AndyT
-
M5 stack :How do I get regional fonts?
-
RE: M5ez, a complete interface builder system for the M5Stack as an Arduino library. Extremely easy to use.
How do i get the characters for my region such as the pound sign £ ?
-
RE: M5Stack Gauges for Boats
Sorry can't help your question. But would like to thank you for your code. Which i have adapted to display temperatures.
-
RE: Drawing random PNG images from SD problem
Cheers Felix,
No it did not compile without errors before. But adding .c.str() solved it .
Thank you again -
Drawing random PNG images from SD problem
How do i get this code to work
this works :
M5.Lcd.drawPngFile(SD,"/Image8.PNG", 0, 0); // display splash screen
but
M5.Lcd.drawPngFile(SD,PngName, 0, 0); // display splash screen
does not in code below.
I want to generate a random slide showint Arand=random(11); String PngName="/Image"+ String (Arand)+".PNG"; Serial.println (PngName); M5.Lcd.drawPngFile(SD,(PngName), 0, 0); // display splash screen
-
RE: Display on during deep sleep?
@andyt I now have the M5Stack black top and a grey top. The ulp program works well to keep the Black top version backlight running at varying levels of brightness. But if i set the PWM to less than 60 on the grey top version. The back light switches off completely after 15 seconds of sleep. which limits the available brightness levels between 60 and 255. which makes the brightness change hardly noticeable Not sure what is going on with the differences between the two M5stacks?
-
RE: Display on during deep sleep?
@felmue Thank you again for the prompt replay. Thank you for the info. I drew a blank at the link you provide as well . Also a good find regarding the pin assignments of the hard coded SDA and SDL for channels 0,1. Did find this link for ulp.h using I_i2C_ READ I_I2C_WRITE etc. But could not get the ZIPed Library to install into my Arduino IDE to try it out.
https://github.com/espressif/esp-idf/blob/master/components/ulp/include/esp32/ulp.h
Maybe start a new thread soon on this as i am getting off the original topic here now that your ULP code above fixed the display going off while sleeping. Just for the record now getting 24hrs off two 700mh add on battery modules at well bright 200 brightness level while the 5Stack is sleeping . -
RE: analogRead on M5Atom
Are you usiing a gpio that does not have a ADC?
Ah yes GPIO19 is not an ADC pin.
here is a picture of the pins of the M5Stack
https://www.instructables.com/Automation-With-SIM800L-ESP32-M5Stack/
PINS 35 or 36 are the ADC's/
-
RE: Display on during deep sleep?
@felmue Seems my Arduino IDE ulp.h does not have a macro I_i2c_RD. And i can't find a way to assemble the raw assembly instruction set i2C_RD. Am i missing something? As i want to take advantage of the the assembly instructions and also the latest set of Macros. Just spent a day going around the internet and came up with nothing. Trying to write ULP code to wake the M5stack when the battery % changes. Sorry again to trouble you.
-
RE: Display on during deep sleep?
@felmue Yes!! Thank you. You are a Genius. Saved me hours. I get it !. It's working in my code.
-
RE: Display on during deep sleep?
@andyt coming From a background of coding 8bit PIC's etc, I have a fare grip on assembler language. So once i get to grips with this ULP coding methods . My next step will be to add a routine to check battery level% change and wake from sleep to update the LCD battery level icon. As at the moment while it is sleeping with the LCD on the M5stack could run out of power and shut down. Or stay displaying the wrong battery level while it sleeps as at the moment it only updates while awake. Just need to get my head around the fundamentals of data handling and storage and setup of ULP. Good that there is more info on this topic these days. Exciting times!!![
My M5stack waking up and quickly turning on wifi, grabbing my local environment agency river levels .and showing the levels and if they are rising or falling triggering speaker alarms and displaying waring icons when reaching or above flood levels. To conserve battery it is asleep while the backlight remains on at a duty cycle dependant on battery level. Getting dimmer as the battery % lowers for 10 minutes minimum and then display the weather forecast from a weather API. cycling through these screens quicker or slower depending on the level of importance to the viewer. So while the river levels are low the weather will be displayed longer. pressing one of the front buttons wakes the device and scrolls to the next page, so that the user can look through the pages at a glance. It's like doing a painting. Always improving to the code to finished slick working device. next stage is to right a nice routine for a user interface to input their own wifi and postcode location. So the device can select local levels and weather. -
RE: Display on during deep sleep?
@felmue Thanks for the link. Lot of code to sift through , spent hours trying to get clues from it. Tried snipets of code out of it, But still can't fully understand what' the problem is. I think i am missing a fundamental principle, how after a SLEEP the esp32 loads all it's variables which would include
RTC_DATA_ATTR int bootCount = 0;
So no wonder it is 0 when the main loop runs, as it is always being set to 0 on wake up. So confused about this from the outset the code even worked in the first place.
But it did work until i introduced the ULP program to PWM a GPIO while sleeping to keep my esp32 M5Stack LCD back light pin operating.
if I don't call the ulp_start(void) routine before sleeping then the ++bootCount increments on each wake just fine.
Why is the below code effecting the RTC_DATA_ATTR int bootCount = 0; ???
what do i need to add to fix it?
I am using the Arduino IDE. So maybe there is an issue on where the Config is assigning the RTC_ to fast or slow ULP memory. I really can't fathom it out. why calling ulp_start(void) resets my counter to 0. Please give me an explanation and solution. Cheers Andy
void ulp_start(void) {
// Slow memory initialization
memset(RTC_SLOW_MEM, 0, 8192);
// M5Stack LCD backlight is connected to GPIO32 (specify by +14)
const gpio_num_t lcdPWMPin = GPIO_NUM_32;
const int lcdPWMBit = RTCIO_GPIO32_CHANNEL + 14;
// GPIO32 initialization (set to output and initial value is 0)
rtc_gpio_init(lcdPWMPin);
rtc_gpio_set_direction(lcdPWMPin, RTC_GPIO_MODE_OUTPUT_ONLY);
rtc_gpio_set_level(lcdPWMPin, 0);
// Define ULP program
const ulp_insn_t ulp_prog[] = {
M_LABEL(1),
I_WR_REG(RTC_GPIO_OUT_REG, lcdPWMBit, lcdPWMBit, 1), // on
I_DELAY(lcdBrightness * 100),
I_WR_REG(RTC_GPIO_OUT_REG, lcdPWMBit, lcdPWMBit, 0), // off
I_DELAY(25500),
M_BX(1),
};
// Run ULP program
size_t size = sizeof(ulp_prog) / sizeof(ulp_insn_t);
ulp_process_macros_and_load(0, ulp_prog, &size);
ulp_run(00);
} -
RE: Display on during deep sleep?
@felmue Thanks for the above routine. Works well. However i was storing a RTC_bootCount so i could display a sequence of images on the screen after waking from sleep. However it seem the ulp over rights the bootCounter stored there. How do i need to change the above code to preserve the RTC_bootCounter?
i tried this but never worked, I am new a ULP coding, so not sure how to locate a free memory space in ULP memory. and retrive it back into the main routine.
// Define ULP program
const ulp_insn_t ulp_prog[] = {
I_ST(ulp_bootCount, R0, 0), // trying to store my bootCounter
M_LABEL(1),
I_WR_REG(RTC_GPIO_OUT_REG, lcdPWMBit, lcdPWMBit, 1), // on
I_DELAY(lcdBrightness * 100),
I_WR_REG(RTC_GPIO_OUT_REG, lcdPWMBit, lcdPWMBit, 0), // off
I_DELAY(25500),
M_BX(1),
};
and in my main code use ++ulp_bootCounter;
please help . Thanks AndyT