ImGui on Arduino example
Use the
By default, the full screen is used with 8bpp (RGB332) color.
- An M5Stack device wih configured display, such as
- Core
- Core2
- CoreS3
- Cardputer (Requires additional Cardputer library)
- Installed M5Unified and M5GFX libraries
- Uncomment
#define IMDUINO_M5GFXat the top ofImDuino.ino
- Change
SCREEN_COLORto other lgfx-defined colors. Note: attempting to use more than 8bpp may result in a frame buffer larger than the maximum heap allocation size. - Adjust
screen.createSprite( M5.Display.width(), M5.Display.height())to a smaller portion of the screen. - Enable alphablending during rasterization by changing
using ColorRaster_t = ColorDisplay_tto a color with an alpha channel e.g.color16_alpha8_torcolor32_t. This will more than double the frame raster time. - Uncomment
screen.setPsram( true )to enable larger frame buffers. Note: this is untested and will be slower if it works.
- The TFT_22_ILI9225 screen and Nkawu's TFT_22_ILI9225 library
- An Arduino with SPI (this example was designed for an ESP32-WROOM-32 "WeMos WiFi & Bluetooth Battery")
- Uncomment
#define IMDUINO_TFT_22_ILI9225at the top ofImDuino.ino
ImDuino is configured by default to use:
- Pin 32 for LED
- Pin 33 for reset
- Pin 27 for RS
- Pin 15 for CS
- Pin 14 for clock
- Pin 13 for SDI
These can be changed by modifying the following constants in ImDuino.ino:
const uint8_t TFTLED = 32;
const uint8_t TFTRST = 33;
const uint8_t TFTRS = 27;
const uint8_t TFTCS = 15;
const uint8_t TFTCLK = 14;
const uint8_t TFTSDI = 13;- The SSD1306 screen and Adafruit's SSD1306 library
- An Arduino with I2C (this example was designed for an ESP32-WROOM-32 "WiFi & Bluetooth Battery OLED")
- Uncomment
#define IMDUINO_SSD1306at the top ofImDuino.ino
ImDuino is configured by default to use:
- Pin 4 for SCL (Serial Clock Line)
- Pin 5 for SDA (Serial Data Line)
- No reset pin
- Address 0x3C
These can be changed by modifying the following constants in ImDuino.ino:
const uint8_t OLEDSDA = 5;
const uint8_t OLEDSCL = 4;
const int8_t OLEDRST = -1;
const uint8_t OLEDADDR = 0x3C;
