stm32l010 oled

Dependencies:   mbed SMALL_SSD1308_128x64_I2C

main.cpp

Committer:
caa45040
Date:
2022-08-05
Revision:
0:cae0ae672424

File content as of revision 0:cae0ae672424:

//oled_test2_16x24_767_1

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

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

// Instantiate OLED
//SSD1308 oled = SSD1308(SSD1308_SA0);

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



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



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

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

//    printf("\r\n<START>\r\n");

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


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



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

    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");
    
    //oled.writeString(0, 0, "Hello World !");  
    
    while(1) {}

}//main



//容量削減
void error(const char* format, ...) {}