diff options
| author | Maxwell Beck <max@rastertail.net> | 2026-10-26 20:32:56 -0500 |
|---|---|---|
| committer | Maxwell Beck <max@rastertail.net> | 2026-10-26 20:32:56 -0500 |
| commit | 2a590986e1ee2aca934181e0ced958c520e97332 (patch) | |
| tree | b731744bc2c26b44646d65a302c489253ba7412e /src/pico1541.c | |
| parent | aa9936120a933f14d52c213a29c6b2b87ec90201 (diff) | |
ssd1306 driver sketch
Diffstat (limited to 'src/pico1541.c')
| -rw-r--r-- | src/pico1541.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/pico1541.c b/src/pico1541.c index e69de29..2c7ad35 100644 --- a/src/pico1541.c +++ b/src/pico1541.c @@ -0,0 +1,25 @@ +#include <hardware/i2c.h> +#include <hardware/gpio.h> +#include <pico/error.h> +#include <pico/time.h> + +#include "ssd1306.h" + +int main() { + gpio_init(20); + gpio_init(21); + + gpio_set_function(20, GPIO_FUNC_I2C); + gpio_set_function(21, GPIO_FUNC_I2C); + + gpio_set_pulls(20, true, false); + gpio_set_pulls(21, true, false); + + i2c_init(i2c0, 400 * 1000); + + ssd1306_t display; + ssd_init(&display, i2c0, 0x3C); + ssd_power_on(&display); + + return 0; +} |
