![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
I have edited the the ssd1306 to add functionality to print through simple function
Dependencies: mbed Adafruit_GFX
main.cpp
- Committer:
- eunkyoungkim
- Date:
- 2015-07-02
- Revision:
- 4:2eed16fd0e71
- Parent:
- 3:847c4451cc97
- Child:
- 6:357ffd6308e4
File content as of revision 4:2eed16fd0e71:
#include "mbed.h" #include "Adafruit_SSD1306.h" DigitalOut myled(LED1); // an SPI sub-class that provides a constructed default class I2CPreInit : public I2C { public: I2CPreInit(PinName sda, PinName scl) : I2C(sda, scl) { frequency(100000); start(); }; }; I2CPreInit gI2C(PA_10,PA_9); Adafruit_SSD1306_I2c gOled(gI2C,NC,0x78,64,128); Serial pc(USBTX,USBRX); int main() { uint16_t x=0; gOled.begin(); gOled.printf("%ux%u Hello World!\r\n", gOled.width(), gOled.height()); gOled.display(); while(1) { myled = !myled; gOled.printf("%u\r",x); gOled.display(); x = x + 1; wait(1); } }