-
1About these instructions...
THis is not a step by step instructions list, but it's a group of suggestions and problems I've found and solved to make this project work.
-
2Before working with ESP8266-01
Before making this Mini Quiz, you need to build some plug-and-play module with a socket where you insert the ESP board to reprogram it. This module will be useful also for some other project where you need to upload a new firmware to ESP8266-01.
-
3PULL up resistors
You still don't know what is a pull up resistor? The two GPIO need pull up resistors, because they need to be HIGH to start the ESP in normal mode. Since there are pull up resistors normally I read 1 when buttons are not pressed and 0 when they are pressed.
-
4LCD Assistant fix
LCD assistant is a tool you can find oline to convert black and white images to an array of bytes that can be easily stored in your code, so you can display it on the Oled. This tool can be downloaded here. But with my SD1306 oled and the Squix library to draw graphics, it doesn't work and the image is messed up. So I've made a PHP script to fix the output of Lcd Assistant, you find it in files section, and it may save you a lot of time.
-
5How can I debug without Serial monitor?
With this project I had to connect the OLED display to TX and RX pin of ESP-01. So I can't connect the ESP-01 to Arduino and I can't open the Serial monitor to debug the code. To avoid this problem I've used the display and I've debugged directly by printing values and stuff to check onto the oled display.
I found this particularly tricky when I'm inside the "mywifimanager.cpp" class.
Infact from inside a library you can't use the oled objects and functions declared in the main.
To accompllish this job in the mywifimanager.h file I've added this public declaration:
void setOLEDCallback( void (*func)(String) );
and this private one:
void (*_oledcallback)(String) = NULL;
And this is how I explicit define it in "mywifimanager.cpp" code:
void WiFiManager2b::setOLEDCallback( void (*func)(String s) ) { _oledcallback = func; }
In this way inside miniquiz.ino I can set up an "echo" function which is passed with a pointer to the mywifimanager file, letting me call _oledcallback("ciao") to print "ciao" from mywifimanager.cpp class.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.