Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Adafruit_GFX mbed
Fork of I2C_SSD1306_nucleo_l432KCc by
Revision 12:f7375e185594, committed 2017-04-17
- Comitter:
- WIzMatthew
- Date:
- Mon Apr 17 01:42:24 2017 +0000
- Parent:
- 11:f4ecb5faeffe
- Child:
- 13:52e9c29e2f88
- Commit message:
- Modify I2C class in main.cpp
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Feb 03 07:37:35 2016 +0000
+++ b/main.cpp Mon Apr 17 01:42:24 2017 +0000
@@ -3,26 +3,20 @@
DigitalOut myled_R(LED_RED);
-// SPI sub-class that provides a constructed default
-class I2CPreInit : public I2C
-{
-public:
- I2CPreInit(PinName sda, PinName scl) : I2C(sda, scl)
- {
- frequency(100000);
- start();
- };
-};
+I2C i2c(PA_10,PA_9);
-I2CPreInit myI2C(PA_10,PA_9);
-Adafruit_SSD1306_I2c myOled(myI2C,NC,0x78,64,128);
+Adafruit_SSD1306_I2c myOled(i2c,NC,0x78,64,128);
+
int main()
{
+ //i2c.frequency(100000);
+ i2c.start();
+
uint16_t x=0;
myOled.begin();
- myOled.printf("%ux%u Hellow World\r\n", myOled.width(), myOled.height());
+ myOled.printf("%ux%u \nHellow World\r\n", myOled.width(), myOled.height());
myOled.display();
while(1)
@@ -34,3 +28,4 @@
wait(1.0);
}
}
+
