ThingPulse / esp8266-oled-ssd1306

Driver for the SSD1306 and SH1106 based 128x64, 128x32, 64x48 pixel OLED display running on ESP8266/ESP32
https://thingpulse.com
Other
2.02k stars 640 forks source link

Temporarily stop frame animation possible? #209

Closed millenseer closed 6 years ago

millenseer commented 6 years ago

Let's take the WorldClockDemo as example. I merged my MQTT-functions in order to display submitted text on the OLED or to blink the LED. But I am unable to stop the animation, do my stuff and then continue the animation after a certain time. Doing my display.clear(); display.drawStringMaxWidth(...); display.display() works well, but the frames will interfere and continue automatically after some time.

Am I missing some ui-functions? Should I reserve a frame for my "stuff" and use switchToFrame() ? Will this stop the animation?

Any example dearly welcome.

RudyFiero commented 6 years ago

Yes you can stop and then restart the frame rotation. I have done this. I added a couple more frames to the rotation. I have a button to pause and restart, but that is only the trigger, and time could be a trigger as well.

It has been a while since I did this and I don't offhand remember how. I'm on laying on the couch with a tablet and it would be too hard to give you an example.

I had used the UI demo as my base.

enableAutoTransition();

disableAutoTransition();

Ok I looked and I am sure the above is what you want.

millenseer commented 6 years ago

Ah, thank you for pointing that one out for me. Only now I understand that transition thing. Works great. Thanks!