Projet C++ / Mbed 2 deprecated Basics_OLED

Dependencies:   SeeedGrayOLED mbed

Fork of seeed_arch_pro_oled by Dan Cohen

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 
00018 SeeedGrayOLED SeeedGrayOled(p9, p10);
00019 
00020 int main()
00021 {
00022 
00023     while(1) {
00024         SeeedGrayOled.init();             //initialize SEEED OLED display
00025         SeeedGrayOled.clearDisplay();     //Clear Display.
00026         SeeedGrayOled.setNormalDisplay(); //Set Normal Display Mode
00027         SeeedGrayOled.setVerticalMode();  // Set to vertical mode for displaying text
00028 
00029         for(char i=1; i < 11 ; i++) {
00030             SeeedGrayOled.setTextXY(i,0);  //set Cursor to first line, 0th column
00031             SeeedGrayOled.setGrayLevel(i); //Set Grayscale level. Any number between 0 - 15.
00032             SeeedGrayOled.putString("FUCK YEAH!!"); //Print whatever the fuck you want
00033             wait_ms(1.0);
00034         }
00035 
00036         wait(5.0);
00037     }
00038 
00039 }