![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
stm32f103c8t6 oled 8x8 new
Dependencies: mbed SSD1306_128x64_I2C
main.cpp@0:50fcc9d50fe8, 2021-03-06 (annotated)
- Committer:
- caa45040
- Date:
- Sat Mar 06 11:07:06 2021 +0000
- Revision:
- 0:50fcc9d50fe8
stm32f103c8t6 oled new
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
caa45040 | 0:50fcc9d50fe8 | 1 | #include "mbed.h" |
caa45040 | 0:50fcc9d50fe8 | 2 | #include "SSD1306.h" |
caa45040 | 0:50fcc9d50fe8 | 3 | |
caa45040 | 0:50fcc9d50fe8 | 4 | #define ADDR (0x3c<<1) // address |
caa45040 | 0:50fcc9d50fe8 | 5 | //#define ADDR (0x3d<<1) // address |
caa45040 | 0:50fcc9d50fe8 | 6 | |
caa45040 | 0:50fcc9d50fe8 | 7 | //I2C i2c(I2C_SDA, I2C_SCL); |
caa45040 | 0:50fcc9d50fe8 | 8 | I2C i2c(PB_7, PB_6); // STM32F103C8 |
caa45040 | 0:50fcc9d50fe8 | 9 | |
caa45040 | 0:50fcc9d50fe8 | 10 | // Host PC Communication channels |
caa45040 | 0:50fcc9d50fe8 | 11 | //Serial pc(USBTX, USBRX); // tx, rx |
caa45040 | 0:50fcc9d50fe8 | 12 | Serial pc(PA_9, PA_10); // tx, rx 103 |
caa45040 | 0:50fcc9d50fe8 | 13 | |
caa45040 | 0:50fcc9d50fe8 | 14 | // Instantiate OLED |
caa45040 | 0:50fcc9d50fe8 | 15 | SSD1306 oled(i2c, ADDR); |
caa45040 | 0:50fcc9d50fe8 | 16 | |
caa45040 | 0:50fcc9d50fe8 | 17 | int main() { |
caa45040 | 0:50fcc9d50fe8 | 18 | pc.baud(9600); |
caa45040 | 0:50fcc9d50fe8 | 19 | oled.writeString(0, 0, "Hello World !"); |
caa45040 | 0:50fcc9d50fe8 | 20 | pc.printf("Printed something\r"); |
caa45040 | 0:50fcc9d50fe8 | 21 | while(1){} |
caa45040 | 0:50fcc9d50fe8 | 22 | } |