sdd1306 stm32l010 h
Dependencies: mbed SSD1308_128x64_I2C
main.cpp@0:84dc6ebb237d, 2022-08-02 (annotated)
- Committer:
- caa45040
- Date:
- Tue Aug 02 06:48:31 2022 +0000
- Revision:
- 0:84dc6ebb237d
ok
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
caa45040 | 0:84dc6ebb237d | 1 | //oled_test2_16x24_767_1 |
caa45040 | 0:84dc6ebb237d | 2 | |
caa45040 | 0:84dc6ebb237d | 3 | #include "mbed.h" |
caa45040 | 0:84dc6ebb237d | 4 | #include "SSD1308.h" |
caa45040 | 0:84dc6ebb237d | 5 | |
caa45040 | 0:84dc6ebb237d | 6 | //i2c initialization |
caa45040 | 0:84dc6ebb237d | 7 | //I2C i2c(I2C_SDA, I2C_SCL); //767 |
caa45040 | 0:84dc6ebb237d | 8 | |
caa45040 | 0:84dc6ebb237d | 9 | // Instantiate OLED |
caa45040 | 0:84dc6ebb237d | 10 | //SSD1308 oled = SSD1308(SSD1308_SA0); |
caa45040 | 0:84dc6ebb237d | 11 | |
caa45040 | 0:84dc6ebb237d | 12 | // Host PC Communication channels |
caa45040 | 0:84dc6ebb237d | 13 | //Serial pc(USBTX, USBRX); // tx, rx |
caa45040 | 0:84dc6ebb237d | 14 | |
caa45040 | 0:84dc6ebb237d | 15 | |
caa45040 | 0:84dc6ebb237d | 16 | |
caa45040 | 0:84dc6ebb237d | 17 | //メイン関数 |
caa45040 | 0:84dc6ebb237d | 18 | int main() |
caa45040 | 0:84dc6ebb237d | 19 | { |
caa45040 | 0:84dc6ebb237d | 20 | |
caa45040 | 0:84dc6ebb237d | 21 | |
caa45040 | 0:84dc6ebb237d | 22 | |
caa45040 | 0:84dc6ebb237d | 23 | int ii; //ループカウンター |
caa45040 | 0:84dc6ebb237d | 24 | int nn; //文字カウンター |
caa45040 | 0:84dc6ebb237d | 25 | |
caa45040 | 0:84dc6ebb237d | 26 | //シリアルの初期化 |
caa45040 | 0:84dc6ebb237d | 27 | // pc.baud(9600); |
caa45040 | 0:84dc6ebb237d | 28 | |
caa45040 | 0:84dc6ebb237d | 29 | // printf("\r\n<START>\r\n"); |
caa45040 | 0:84dc6ebb237d | 30 | |
caa45040 | 0:84dc6ebb237d | 31 | // Instantiate OLED |
caa45040 | 0:84dc6ebb237d | 32 | SSD1308 oled = SSD1308(SSD1308_SA0); |
caa45040 | 0:84dc6ebb237d | 33 | |
caa45040 | 0:84dc6ebb237d | 34 | |
caa45040 | 0:84dc6ebb237d | 35 | //charge pump add=>ca45040 |
caa45040 | 0:84dc6ebb237d | 36 | //i2c.write(SSD1308_SA0, "\200\215\200\024", 4); //0x80,0x8d,0x80,0x14 |
caa45040 | 0:84dc6ebb237d | 37 | //set access |
caa45040 | 0:84dc6ebb237d | 38 | //oled.setDisplayFlip(false, false); |
caa45040 | 0:84dc6ebb237d | 39 | |
caa45040 | 0:84dc6ebb237d | 40 | |
caa45040 | 0:84dc6ebb237d | 41 | |
caa45040 | 0:84dc6ebb237d | 42 | //char n1_8[] = "12345678"; |
caa45040 | 0:84dc6ebb237d | 43 | char n1_8[] = "87654321"; |
caa45040 | 0:84dc6ebb237d | 44 | //char n1_8[] = "88888888"; |
caa45040 | 0:84dc6ebb237d | 45 | |
caa45040 | 0:84dc6ebb237d | 46 | ii=0; |
caa45040 | 0:84dc6ebb237d | 47 | for(nn=0; nn<8; nn++) { |
caa45040 | 0:84dc6ebb237d | 48 | // y x |
caa45040 | 0:84dc6ebb237d | 49 | oled.writeBigChar(0, ii*16,n1_8[nn]); |
caa45040 | 0:84dc6ebb237d | 50 | ii = ii + 1; |
caa45040 | 0:84dc6ebb237d | 51 | } //for |
caa45040 | 0:84dc6ebb237d | 52 | //pc.printf("Printed something\r\n"); |
caa45040 | 0:84dc6ebb237d | 53 | // printf("Printed something\r\n"); |
caa45040 | 0:84dc6ebb237d | 54 | |
caa45040 | 0:84dc6ebb237d | 55 | //oled.writeString(0, 0, "Hello World !"); |
caa45040 | 0:84dc6ebb237d | 56 | |
caa45040 | 0:84dc6ebb237d | 57 | while(1) {} |
caa45040 | 0:84dc6ebb237d | 58 | |
caa45040 | 0:84dc6ebb237d | 59 | }//main |
caa45040 | 0:84dc6ebb237d | 60 | |
caa45040 | 0:84dc6ebb237d | 61 | |
caa45040 | 0:84dc6ebb237d | 62 | |
caa45040 | 0:84dc6ebb237d | 63 | //容量削減 |
caa45040 | 0:84dc6ebb237d | 64 | void error(const char* format, ...) {} |
caa45040 | 0:84dc6ebb237d | 65 | |
caa45040 | 0:84dc6ebb237d | 66 |