Projet C++ / Mbed 2 deprecated MBED_CPP_DII4A

Dependencies:   SeeedGrayOLED mbed

Fork of MBED_CPP_DII4A by Projet C++

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 /*
00002  *  Copyright (c) 2012 Neal Horman - http://www.wanlink.com
00003  *
00004  *  License: MIT open source (http://opensource.org/licenses/MIT)
00005  *      Summary;
00006  *      Use / modify / distribute / publish it how you want and
00007  *      if you use it, or don't, you can't hold me liable for how
00008  *      it does or doesn't work.
00009  *      If it doesn't work how you want, don't use it, or change
00010  *      it so that it does work.
00011  */
00012 
00013 #include "mbed.h"
00014 #include "SeeedGrayOLED.h"
00015 
00016 DigitalOut myLed(LED1);
00017 DigitalIn greenPB(p20);
00018 SeeedGrayOLED SeeedGrayOled(p9, p10);
00019 
00020 int main()
00021 {
00022     greenPB.mode(PullUp);
00023     while(1) 
00024     {
00025         if(!greenPB)
00026         {
00027             SeeedGrayOled.init();             //initialize SEEED OLED display
00028             SeeedGrayOled.clearDisplay();     //Clear Display.
00029             SeeedGrayOled.setNormalDisplay(); //Set Normal Display Mode
00030             SeeedGrayOled.setVerticalMode();  // Set to vertical mode for displaying text
00031             SeeedGrayOled.setTextXY(0,0);
00032             SeeedGrayOled.setGrayLevel(10);
00033             SeeedGrayOled.putString("Ce message est plutot long ma foi");
00034         //wait_ms(1.0);
00035             
00036         }
00037 
00038         //for(char i=1; i < 11 ; i++) {
00039         //    SeeedGrayOled.setTextXY(i,0);  //set Cursor to first line, 0th column
00040         //    SeeedGrayOled.setGrayLevel(i); //Set Grayscale level. Any number between 0 - 15.
00041         //    SeeedGrayOled.putString("yep"); //Print whatever you want
00042         //    wait_ms(1.0);
00043         //}
00044 
00045         wait_ms(5.0);
00046     }
00047 
00048 }