C++ project

Dependencies:   SeeedGrayOLED mbed

Fork of MBED_CPP_DII4A by Projet C++

Committer:
mr_cub3
Date:
Mon Mar 13 08:35:17 2017 +0000
Revision:
1:e1e7d89e37fe
Parent:
0:cc27e545a4de
Child:
2:fa5b67d8d989
dfzqofqn

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mr_cub3 0:cc27e545a4de 1 #include "mbed.h"
mr_cub3 1:e1e7d89e37fe 2 #include "SeeedGrayOLED.h"
mr_cub3 0:cc27e545a4de 3
mr_cub3 1:e1e7d89e37fe 4 DigitalOut myLed(LED1);
mr_cub3 1:e1e7d89e37fe 5 DigitalIn greenPB(p20);
mr_cub3 1:e1e7d89e37fe 6 SeeedGrayOLED SeeedGrayOled(p9, p10);
mr_cub3 0:cc27e545a4de 7
mr_cub3 1:e1e7d89e37fe 8 int main()
mr_cub3 1:e1e7d89e37fe 9 {
mr_cub3 1:e1e7d89e37fe 10 //greenPB.mode(PullUp);
mr_cub3 0:cc27e545a4de 11 while(1) {
mr_cub3 1:e1e7d89e37fe 12 //myLed = greenPB;
mr_cub3 1:e1e7d89e37fe 13 SeeedGrayOled.init(); //initialize SEEED OLED display
mr_cub3 1:e1e7d89e37fe 14 SeeedGrayOled.clearDisplay(); //Clear Display.
mr_cub3 1:e1e7d89e37fe 15 SeeedGrayOled.setNormalDisplay(); //Set Normal Display Mode
mr_cub3 1:e1e7d89e37fe 16 SeeedGrayOled.setVerticalMode(); // Set to vertical mode for displaying text
mr_cub3 1:e1e7d89e37fe 17 SeeedGrayOled.setTextXY(0,0);
mr_cub3 1:e1e7d89e37fe 18 SeeedGrayOled.setGrayLevel(10);
mr_cub3 1:e1e7d89e37fe 19 SeeedGrayOled.putString("Coucou Candy");
mr_cub3 1:e1e7d89e37fe 20 wait_ms(1.0);
mr_cub3 1:e1e7d89e37fe 21 //for(char i=1; i < 11 ; i++) {
mr_cub3 1:e1e7d89e37fe 22 // SeeedGrayOled.setTextXY(i,0); //set Cursor to first line, 0th column
mr_cub3 1:e1e7d89e37fe 23 // SeeedGrayOled.setGrayLevel(i); //Set Grayscale level. Any number between 0 - 15.
mr_cub3 1:e1e7d89e37fe 24 // SeeedGrayOled.putString("FUCK YEAH!!"); //Print whatever the fuck you want
mr_cub3 1:e1e7d89e37fe 25 // wait_ms(1.0);
mr_cub3 1:e1e7d89e37fe 26 //}
mr_cub3 1:e1e7d89e37fe 27
mr_cub3 1:e1e7d89e37fe 28 wait(5.0);
mr_cub3 0:cc27e545a4de 29 }
mr_cub3 1:e1e7d89e37fe 30
mr_cub3 1:e1e7d89e37fe 31 }