C++ project
Dependencies: SeeedGrayOLED mbed
Fork of MBED_CPP_DII4A by
Revision 4:c2db59ea2838, committed 2017-03-13
- Comitter:
- mr_cub3
- Date:
- Mon Mar 13 18:51:17 2017 +0000
- Parent:
- 3:d1f3794f7899
- Child:
- 5:65e3a465f9b1
- Commit message:
- youplaboum
Changed in this revision
| WeatherClick_I2C.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/WeatherClick_I2C.lib Mon Mar 13 18:28:18 2017 +0000 +++ b/WeatherClick_I2C.lib Mon Mar 13 18:51:17 2017 +0000 @@ -1,1 +1,1 @@ -https://developer.mbed.org/teams/mr_cub3/code/WeatherClick_I2C/#003c0eaa6e64 +https://developer.mbed.org/teams/mr_cub3/code/WeatherClick_I2C/#f0a85ed3f130
--- a/main.cpp Mon Mar 13 18:28:18 2017 +0000
+++ b/main.cpp Mon Mar 13 18:51:17 2017 +0000
@@ -1,12 +1,48 @@
-#include "mbed.h"
+/*
+ * Copyright (c) 2012 Neal Horman - http://www.wanlink.com
+ *
+ * License: MIT open source (http://opensource.org/licenses/MIT)
+ * Summary;
+ * Use / modify / distribute / publish it how you want and
+ * if you use it, or don't, you can't hold me liable for how
+ * it does or doesn't work.
+ * If it doesn't work how you want, don't use it, or change
+ * it so that it does work.
+ */
-DigitalOut myled(LED1);
+#include "mbed.h"
+#include "SeeedGrayOLED.h"
+
+DigitalOut myLed(LED1);
+DigitalIn greenPB(p20);
+SeeedGrayOLED SeeedGrayOled(p9, p10);
-int main() {
- while(1) {
- myled = 1;
- wait(0.2);
- myled = 0;
- wait(0.2);
+int main()
+{
+ greenPB.mode(PullUp);
+ while(1)
+ {
+ if(!greenPB)
+ {
+ SeeedGrayOled.init(); //initialize SEEED OLED display
+ SeeedGrayOled.clearDisplay(); //Clear Display.
+ SeeedGrayOled.setNormalDisplay(); //Set Normal Display Mode
+ SeeedGrayOled.setVerticalMode(); // Set to vertical mode for displaying text
+ SeeedGrayOled.setTextXY(0,0);
+ SeeedGrayOled.setGrayLevel(10);
+ SeeedGrayOled.putString("Coucou");
+ //wait_ms(1.0);
+
+ }
+
+ //for(char i=1; i < 11 ; i++) {
+ // SeeedGrayOled.setTextXY(i,0); //set Cursor to first line, 0th column
+ // SeeedGrayOled.setGrayLevel(i); //Set Grayscale level. Any number between 0 - 15.
+ // SeeedGrayOled.putString("FUCK YEAH!!"); //Print whatever the fuck you want
+ // wait_ms(1.0);
+ //}
+
+ wait_ms(5.0);
}
-}
+
+}
\ No newline at end of file
