The wifi connected image is correctly shown as soon as soon as the NodeMCU I am using connects to Wifi. When I disconnect from wifi I expect the other image to show, but I still see the wifi-connected image. I need to specifically use a clear-command to remove everything (there is only a wifi-signal image) before showing the wifi-disconnected image. Strangely enough, it works the other way around. This makes me think that the zero's in the wifi-disconnected icon are not correctly resetting the one's from the wifi-connected icon.
var wifiDisconnectImage = function() {
console.log("Disconnect icon should show");
graph.clear(); // <- required to clear OLED
graph.drawImage(imgNoNetworkSignal, graph.getWidth()-8, 0);
graph.flip();
};
var wifiConnectImage = function() {
console.log("Connect icon should show");
// graph.clear(); <--- works without the clear
graph.drawImage(imgNetworkSignal, graph.getWidth()-8, 0);
graph.flip();
};
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I have defined two images in code. One is shown when wifi is connected/associated, the other is shown when wifi disconnects.
The wifi connected image is correctly shown as soon as soon as the NodeMCU I am using connects to Wifi. When I disconnect from wifi I expect the other image to show, but I still see the wifi-connected image. I need to specifically use a clear-command to remove everything (there is only a wifi-signal image) before showing the wifi-disconnected image. Strangely enough, it works the other way around. This makes me think that the zero's in the wifi-disconnected icon are not correctly resetting the one's from the wifi-connected icon.