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_Helloworld_WIZwiki-W7500 by
Diff: main.cpp
- Revision:
- 9:a6021ca48d2e
- Parent:
- 8:e61e86355653
- Child:
- 10:abbd34fe7ce1
diff -r e61e86355653 -r a6021ca48d2e main.cpp
--- a/main.cpp Fri Jul 24 01:20:00 2015 +0000
+++ b/main.cpp Wed Aug 05 00:07:56 2015 +0000
@@ -1,10 +1,8 @@
#include "mbed.h"
#include "Adafruit_SSD1306.h"
-DigitalOut shield_led_off(D10);
DigitalOut myled_R(LED1);
-
// an SPI sub-class that provides a constructed default
class I2CPreInit : public I2C
{
@@ -16,26 +14,23 @@
};
};
-I2CPreInit gI2C(PA_10,PA_9);
-Adafruit_SSD1306_I2c gOled(gI2C,NC,0x78,64,128);
-Serial pc(USBTX,USBRX);
+I2CPreInit myI2C(PA_10,PA_9);
+Adafruit_SSD1306_I2c myOled(myI2C,NC,0x78,64,128);
int main()
-{ uint16_t x=0;
-
- shield_led_off = 0; // turn off Green LED on shield
+{
+ uint16_t x=0;
- gOled.begin();
- gOled.printf("%ux%u Hellow World\r\n", gOled.width(), gOled.height());
- gOled.display();
-
+ myOled.begin();
+ myOled.printf("%ux%u Hellow World\r\n", myOled.width(), myOled.height());
+ myOled.display();
while(1)
{
myled_R = !myled_R;
- gOled.printf("%u\r",x);
- gOled.display();
- x = x + 1;
- wait(1);
+ myOled.printf("%u\r",x);
+ myOled.display();
+ x = x + 1;
+ wait(1.0);
}
}
