This was caused by a missing double quotation mark in a file name in an "Execute code" block.....
Best posts made by wsanders
-
RE: UIFlow "Invalid Syntax"?
-
RE: M5STACK STATION PORT CONNECTORS
You want UNbuckled "Grove" connectors to fit all M5Stack devices. For example, the M5StickC-Plus will accept both unbuckled and bucked connectors, but the Core2 will only accept an unbuckled connector. If you have the buckled type, you can always cut the clip off so it will fit.
Generically, these connectors are called "HY2.0-4P" although nearly all vendors sell them as "Grove".
There's no standard for the Vcc and logic levels! So make sure your devices match. M5Stack devices supply 5V on the red conductor, but the logic levels are 3.3V.
-
RE: M5StickC-Plus Buzzer not working
Using //https://101010.fun/iot/m5stickc-plus-firststep.html
for inspiration, we can upload this program:#include <M5StickCPlus.h>
void setup() {
M5.begin();
M5.Lcd.setTextSize(3);
M5.Lcd.setRotation(3);
M5.Lcd.setTextColor(TFT_ORANGE);
}void loop() {
M5.update();
soundTest();
}void soundTest() {
for (int tone=100; tone < 4000; tone=tone+50) {
M5.Lcd.fillScreen(BLACK);
M5.Lcd.setCursor(80, 50);
M5.Lcd.printf("%d", tone);
M5.Beep.tone(tone);
M5.Beep.update();
delay(200);
}
}According to my ears there is a definite peak about 2500 Hz, with frequencies under 250 Hz and over 3000 not audible. Your ears may vary .....
-
UIFlow: How to try/except for "Connect to Wifi"?
I am trying to get the program to ignore failure to connect to WiFi. I tried to place a Wifi Connect block inside a try/except (with a bogus SSID/password):
Instead, the program hangs, before the LED comes on, because the python that gets generated places the wifiCfg.doConnect up at the top of the program (line 20):
and the try/except block is empty, much later in the program at line 87:
Is there a way to create an exception for WiFi failure to connect?
I also notice that UIFlow does not have a "pass" block. I just put a wait() in mine - ???
-
RE: [SOLVED] Can't Run Paper S3 With BarGraph Example
I got the bar graph demo to work:
-
Using the latest M5 board package, you should see a board "M5PaperS3", so the requirement to downgrade the esp32 board package to 3.0.6 is not necessary. Use the "M5PaperS3" board definition instead of the generic ESP32S3 one.
-
The instructions to install epdiy are somewhat vague. Simply clone the epdiy library to your arduino library directory and it will work, doing a "make" is not necessary.
-
Follow the rest of the instructions at https://docs.m5stack.com/en/arduino/m5papers3/program, pay careful attention to the special board settings for OPI PSRAM, etc.
-
-
TZ magic in ESP/M5Unified
Mt RTC is set to UTC. Somehow, this magically works:
setenv("TZ","PST8PDT",1); tzset(); auto tm = localtime(&t); M5.Display.printf("ESP32 %04d/%02d/%02d (%s) %02d:%02d:%02d\r\n", tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday, wd[tm->tm_wday], tm->tm_hour, tm->tm_min, tm->tm_sec);
Just posting here in case someone is mystified by the Rtc.ino example, since it doesn't set the TZ "environment variable" the calls to localtime and gmtime will return the same.
-
RE: UIFlow: How to try/except for "Connect to Wifi"?
@wsanders SOLUTION: Use "Original Network Function" blocks instead.
-
RE: How to use "pushToSprite" in Core2
Isn't the method called pushSprite?
On a M5StickC-Plus, I use:
setup():
TFT_eSprite sgraph = TFT_eSprite(&M5.Lcd);
...
sgraph.createSprite(GRAPHW, GRAPHH);
...loop():
...
sgraph.pushSprite(TEXTW, 0);
.... -
RE: Anybody get drawJpgFile to work with M5 PaperS3?
Now that I think of it, I could not get drawJpgFile to work in a previous project (a fake Nixie watch), and I see from the PaperS3 demo program sample code that the Jpg is stored as a static array.
I got my simple badge display program to work by storing the image as a C array (exported from GIMP) and walking through the pixels, which is how I did it in my previous project. Suprisingly it's not incredibly slow but of course data in this format is incredibly bulky.
This github code is an example of how to convert a file into a statoc C array: https://github.com/notisrac/FileToCArray
In the next few days, maybe I'll figure out if SPIFFS works on the PaperS3 and report back.
-
Solution: Getting decent looking fonts on PaperS3
I'm trying to get decent-looking fonts on the PaperS3. As called by setFont, the fonts are huge and blocky (unaliased). However, If they are subsequently scaled by setTextSize, even wth a scale of 1.0, they are the right size and smooth.
You have to experiment. For example, with Font6 and Font8, punctuation charactersaren't rendered, I am guessing to save space. But Font4 scaled up to 2.0 looks very nice.
I've attached a couple of images that show this effect:
M5.Display.setFont(&fonts::Font4), without scaling:
M5.Display.setFont(&fonts::Font4);
M5.Display.setTextSize(2.0);
Not sure if this is a bug or a feature, but it works!