-
• #2
Hi,
Thanks for posting. Interesting to see that you are loading the module dynamically:
https://github.com/wga22/esp8266/blob/master/espurino/ESP32_drawforecast.js#L64Why are you doing that?
A line or two between the text rows might be a bit more readable!
-
• #3
@Wilberforce good tip on the line between text. That code has room for improvement in that I might like to use regex to split the text in a more natural place.
I do load the module dynamically, because I thought I had to. Perhaps you're suggesting I only need to do that prior to the save?
-
• #5
Oh, I am using the webIDE (love it), I didn't realize it would do that for me. Very cool.
-
• #6
As you already have
graphics = require("SSD1306").connect(I2C1, initGraphics, { height : 64 });
You can get rid of your oninit() that calls load module.
Kind of a "quick" project to get comfortable with the ESP32.
It connects to the wunderground API, and pulls the latest forecast string, and displays across SSD1306 (I also wrote a version with the HD44780 I2C).
See the code here:
https://github.com/wga22/esp8266/blob/master/espurino/ESP32_drawforecast.js
Interesting part of the code is the parsing of the JSON from wunderground. Not my best code, just slopping something together to see how it works. Love the ESP32, has right level of performance for doing real level of work. Hoping ESPRUINO team continues to get it love! A special thanks to the brilliance of the "loadModule" versatility!
1 Attachment