@EmojiTetra is an online game resembling Tetris, hosted on Twitter platform.
Every 20 minutes, the @EmojiTetra account posts a tweet that displays the current game board, along with a four-option poll that allows visitors to vote for the game's next move: left, right, down, rotate, or plummet.
I find this game interesting.
To watch or participate in @EmojiTetra, I need to unlock my tablet, open Twitter app, search for "EmojiTetra", and scroll past the pinned tweet in order to see the current game move.
In total, this process needs 17 taps.
Looking at the 0.96 inch OLED display on my Heltec WiFi_Kit_32 board, I'm thinking: can I play @EmojiTetra on an ESP32?
Twitter offers an API that allows applications to retrieve and post tweets.
GET statuses/user_timeline resource, for example, retrieves a collection of the most recent tweets posted by a specific user.
To watch the game, "user timeline" is exactly what I need to retrieve the current game state.
It is considered bad practice to hard-code WiFi credentials into Arduino sketches.
Typical recommendations include the WiFiManager library for ESP8266, and SmartConfig for ESP32.
Both require the user to have a smartphone to send command to the ESP chip, which otherwise does not have any User Interface (UI).
My ESP32 board is the Heltec WiFi_Kit_32 that comes with a 0.96 inch OLED display and a little PRG button connected to pin #0.
Can I use these minimal UI to enter WiFi credentials without involving a smartphone?
Design with Minimal UI
I took inspiration from Prof Stephen Hawking's computer:
I've been playing with ESP8266 for one and a half years now.
Recently, I'm upgrading to its bigger brother, the ESP32.
I purchased two development boards, one of them is the Heltec WiFi_Kit_32 that comes with a 0.96 inch OLED display.
When 2018 arrives, what's a better way to say Happy New Year than on the ESP32?
Therefore, I crawled out of the bed at 4AM, turned on the computer, and started Arduino IDE.
Half an hour later, I tweeted this picture:
The code is simple yet effective.
It was modified from u8g2 library full_buffer/HelloWorld example, with the constructor line found on Robot Zero One.