LoginSignup
0
0

More than 1 year has passed since last update.

STM32F303K8とOLED、AL12832AWWB-H-U02でHello Worldを表示(U8g2lib)

Last updated at Posted at 2020-12-08

1.ardiuno ide 1.8.11にSTM32 Corasをインストール
2.u8g2ライブラリーをインストール
3.ソースの例からHelloWorldを選択
4.U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // Adafruit ESP8266/32u4/ARM Boards + FeatherWing OLED
を選択

おまけ
3.3Vを5Vに変換する為にPFMステップアップDC/DCコンバーター HT7750A(5個入)とコンデンサー2個とコイルとダイオードを使用した。
マイコンは、STM32 Nucleo Board STM32F303K8


#include <Arduino.h>
#include <U8g2lib.h>

#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#endif

U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);  // Adafruit ESP8266/32u4/ARM Boards + FeatherWing OLED

void setup(void) {
  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);  
}

image_original (11).jpg

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0