Projects · Hello World 3D

Hello world plus 3D

Arduino demo for RP2350 driving a 128×64 SSD1306 OLED over I2C - custom font, Lissajous curve, 3D smiley with wobble and roll, and wireframe shapes. Display updates use pico-sdk I2C with DMA.

Full write-up (hardware, software, overclock notes)

Warning - overclocked CPU and I2C

This sketch pushes the hardware beyond typical defaults:

  • CPU: 200 MHz via set_sys_clock_khz(200000, true) in setup1() on core 1 (above the default system clock).
  • I2C: 2 MHz via #define I2C_CLOCK_HZ 2000000 and i2c_init(OLED_I2C, I2C_CLOCK_HZ). Many SSD1306 modules and wiring setups are rated for 400 kHz (I2C Fast mode) or lower. Running I2C faster can cause garbled displays, missed updates, or bus errors, especially with long wires or weak pull-ups.

Use at your own risk. If anything looks unstable, revert one or both settings below.

To run at default/safer settings

  1. Open Hello-world-plus-3D.ino.
  2. CPU - find setup1() (near the top of the file, after the display driver class). Delete or comment out:
    set_sys_clock_khz(200000, true);
  3. I2C - near the top #define block, change the bus speed to a standard rate, for example:
    #define I2C_CLOCK_HZ 400000
    (400000 = 400 kHz Fast mode; 100000 = 100 kHz Standard mode if your module still misbehaves.)
  4. Optional cleanup: if you also remove the commented vreg_set_voltage(...) line, you can delete these includes if nothing else needs them:
    #include "hardware/vreg.h"
    #include "hardware/clocks.h"
  5. Leave setup1() / loop1() in place - core 1 still updates lissa_phase for the Lissajous animation.

Re-upload the sketch after editing. Animations may run slower at the default CPU clock; that is expected. Lower I2C speed may also reduce frame rate but should improve reliability.

Hardware

ItemDetail
MCURP2350
DisplaySSD1306, 128×64, I2C address 0x3C
I2C porti2c0
SDAGPIO 0
SCLGPIO 1

Software

  • Arduino-Pico board support (RP2350)
  • Adafruit GFX Library
  • Adafruit SSD1306 Library

Open Hello-world-plus-3D.ino in the Arduino IDE (folder name must match the .ino filename).

GitHub Actions compiles this sketch on every push to master (compile check only; does not upload to the board).