C++ project
Dependencies: SeeedGrayOLED mbed
Fork of MBED_CPP_DII4A by
main.cpp@2:fa5b67d8d989, 2017-03-13 (annotated)
- Committer:
- mr_cub3
- Date:
- Mon Mar 13 18:25:52 2017 +0000
- Revision:
- 2:fa5b67d8d989
- Parent:
- 1:e1e7d89e37fe
bastien
Who changed what in which revision?
User | Revision | Line number | New 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 | 2:fa5b67d8d989 | 10 | greenPB.mode(PullUp); |
mr_cub3 | 2:fa5b67d8d989 | 11 | while(1) |
mr_cub3 | 2:fa5b67d8d989 | 12 | { |
mr_cub3 | 2:fa5b67d8d989 | 13 | |
mr_cub3 | 2:fa5b67d8d989 | 14 | |
mr_cub3 | 2:fa5b67d8d989 | 15 | |
mr_cub3 | 2:fa5b67d8d989 | 16 | myLed = !greenPB; |
mr_cub3 | 2:fa5b67d8d989 | 17 | |
mr_cub3 | 2:fa5b67d8d989 | 18 | //SeeedGrayOled.init(); //initialize SEEED OLED display |
mr_cub3 | 2:fa5b67d8d989 | 19 | //SeeedGrayOled.clearDisplay(); //Clear Display. |
mr_cub3 | 2:fa5b67d8d989 | 20 | //SeeedGrayOled.setNormalDisplay(); //Set Normal Display Mode |
mr_cub3 | 2:fa5b67d8d989 | 21 | //SeeedGrayOled.setVerticalMode(); // Set to vertical mode for displaying text |
mr_cub3 | 2:fa5b67d8d989 | 22 | //SeeedGrayOled.setTextXY(0,0); |
mr_cub3 | 2:fa5b67d8d989 | 23 | //SeeedGrayOled.setGrayLevel(10); |
mr_cub3 | 2:fa5b67d8d989 | 24 | //SeeedGrayOled.putString("Coucou Candy"); |
mr_cub3 | 2:fa5b67d8d989 | 25 | //wait(1); |
mr_cub3 | 2:fa5b67d8d989 | 26 | |
mr_cub3 | 2:fa5b67d8d989 | 27 | |
mr_cub3 | 2:fa5b67d8d989 | 28 | |
mr_cub3 | 2:fa5b67d8d989 | 29 | |
mr_cub3 | 1:e1e7d89e37fe | 30 | //for(char i=1; i < 11 ; i++) { |
mr_cub3 | 1:e1e7d89e37fe | 31 | // SeeedGrayOled.setTextXY(i,0); //set Cursor to first line, 0th column |
mr_cub3 | 1:e1e7d89e37fe | 32 | // SeeedGrayOled.setGrayLevel(i); //Set Grayscale level. Any number between 0 - 15. |
mr_cub3 | 1:e1e7d89e37fe | 33 | // SeeedGrayOled.putString("FUCK YEAH!!"); //Print whatever the fuck you want |
mr_cub3 | 1:e1e7d89e37fe | 34 | // wait_ms(1.0); |
mr_cub3 | 1:e1e7d89e37fe | 35 | //} |
mr_cub3 | 1:e1e7d89e37fe | 36 | |
mr_cub3 | 2:fa5b67d8d989 | 37 | //wait(1.0); |
mr_cub3 | 0:cc27e545a4de | 38 | } |
mr_cub3 | 1:e1e7d89e37fe | 39 | |
mr_cub3 | 1:e1e7d89e37fe | 40 | } |