Seeed Grove OLED example program for mbed on NCS36510

Dependencies:   SeeedGrayOLED mbed-os

main.cpp

Committer:
jacobjohnson
Date:
2017-01-25
Revision:
1:fe4baf28935e
Parent:
0:8fbbced097c5

File content as of revision 1:fe4baf28935e:

#include "mbed.h"
#include "SeeedGrayOLED.h"

DigitalOut led1(LED1);
SeeedGrayOLED SeeedGrayOled(I2C1_SDATA_1, I2C1_SCLK_1);

int main() {
      
    SeeedGrayOled.init();
    SeeedGrayOled.clearDisplay();
    SeeedGrayOled.setNormalDisplay();
    SeeedGrayOled.setVerticalMode();
    
    while (true) 
    {        
        for(char i=1; i<11; i++)
        {
            led1 = !led1;
            SeeedGrayOled.setTextXY(i,1);       //1st row, 0th column
            SeeedGrayOled.setGrayLevel(i);      //Set Grayscale level. Any number between 0 - 15.
            SeeedGrayOled.putString("Hello World");
            Thread::wait(10);
       }
        Thread::wait(5000);
    }
}