Introduction to TTGO T Controller

Currently, this blog post summarizes my first impressions and steps with this module. I will update this post with more code and examples later.
Table of Contents
The Hardware
You can get the module via https://www.aliexpress.com/item/32970371816.html
It contains the following components:
- ESP32-WROVER-B š google Module
- SSD1306 128X64 0.96ā OLED Display (
21=SDA
,22=SCL
) - a 5-way Joystick (
32="up"
,33="down"
,34="center"
,36="left"
,39="right"
) - (guess) Silergy Corp SY8089AAAC š google
- 2A continuous step down regulator
- with a quiescent current of 55uA.
- (guess) NanJing Top Power ASIC Corp TP5400 š google
- 1000mAh Lipo Charger
- 5V Step up regulator (1A)
- The quiescent current is at 40uA
- The Datasheet is in chinese, so theses properties are guesses
- It has a standby LED and a charge LED (which blinks when there is no Li-Ion battery present)
- 18650 Li-Ion battery holder on the back
The Software
Flashing
Provided Example
TTGO provided an example on GitHub: https://github.com/LilyGO/TTGO-T-Lion-T18V2.2-/blob/master/T18_V2.2/adc.ino.
Simple Example
As Iām not a fan of complicated smoke tests (i.e. having to install too many libraries to get it to work), I shortened it to:
#include <Arduino.h>
#include "SSD1306.h"
#define SSD1306_ADDRESS 0x3c
#define I2C_SDA 21
#define I2C_SCL 22
SSD1306 oled(SSD1306_ADDRESS, I2C_SDA, I2C_SCL);
void setup()
{
Serial.begin(115200);
oled.init();
oled.flipScreenVertically();
oled.setFont(ArialMT_Plain_16);
oled.setTextAlignment(TEXT_ALIGN_CENTER);
delay(50);
oled.clear();
oled.drawString(oled.getWidth() / 2, oled.getHeight() / 2, "TTGO");
oled.display();
}
void loop()
{
delay(100);
}
Using u8g2
When using the u8g2 library you will need to use the following constructor:
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, 21, 22);
Note, I had to provide the SDA
/SCL
pins diretly via the constructor, otherwise only half the display was drawn.
A minimal working example would be:
#include <Arduino.h>
#include <U8g2lib.h>
#include <Wire.h>
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, 21, 22);
void setup(void) {
// init display
u8g2.begin();
}
void loop(void) {
u8g2.clearBuffer(); // clear the internal memory
u8g2.setFont(u8g2_font_ncenB08_tr); // choose a suitable font
u8g2.drawStr(0,10,"Hello World!"); // write something to the internal memory
u8g2.sendBuffer(); // transfer internal memory to the display
delay(1000);
}
I uploaded example code to https://github.com/uvwxy/ttgo-t-controller-u8g2 which demonstrates this module using the u8g2 library (https://github.com/olikraus/u8g2).
See below for the result: