LoginSignup
0
0

More than 1 year has passed since last update.

STM32F767とOLED、OLED096UNO-Aで12345678を表示(16x24)(改良)(SSD1306)

Last updated at Posted at 2022-07-29

x Mbed2のリビジョン143です。
x SSD1308_128x64_I2Cのライブラリが必要です。

目的
OLEDのテスト

o_con599.jpg

o_con600.jpg




//oled_test2_16x24_767_1

#include "mbed.h"
#include "SSD1308.h"

//i2c initialization
I2C i2c(I2C_SDA, I2C_SCL); //767

// Instantiate OLED
SSD1308 oled = SSD1308(&i2c, SSD1308_SA0);

// Host PC Communication channels
Serial pc(USBTX, USBRX); // tx, rx

//メイン関数
int main()
{

    int ii; //ループカウンター
    int nn; //文字カウンター

    //charge pump  add=>ca45040
    i2c.write(SSD1308_SA0, "\200\215\200\024", 4); //0x80,0x8d,0x80,0x14
    //set access
    oled.setDisplayFlip(false, false);

    //シリアルの初期化
    pc.baud(9600);

    //char n1_8[] = "12345678";
    char n1_8[] = "87654321";

    ii=0;
    for(nn=0; nn<8; nn++) {
        //                y   x
        oled.writeBigChar(0, ii*16,n1_8[nn]);
        ii = ii + 1;
    } //for
    pc.printf("Printed something\r\n");
    //printf("Printed something\r\n");
    while(1) {}

}//main



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