Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp@0:e77abf0991bf, 2014-06-08 (annotated)
- Committer:
- allankliu
- Date:
- Sun Jun 08 10:59:42 2014 +0000
- Revision:
- 0:e77abf0991bf
Demo LPC1114 with SSD1306.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
allankliu | 0:e77abf0991bf | 1 | #include "mbed.h" |
allankliu | 0:e77abf0991bf | 2 | |
allankliu | 0:e77abf0991bf | 3 | #include "ssd1306.h" |
allankliu | 0:e77abf0991bf | 4 | #include "standard_font.h" |
allankliu | 0:e77abf0991bf | 5 | #include "bold_font.h" |
allankliu | 0:e77abf0991bf | 6 | |
allankliu | 0:e77abf0991bf | 7 | SSD1306 oled(p8 /* cs */, p9 /* reset */, p14 /* dc */, |
allankliu | 0:e77abf0991bf | 8 | p13 /* clock */, p11 /* data */); |
allankliu | 0:e77abf0991bf | 9 | |
allankliu | 0:e77abf0991bf | 10 | int main() |
allankliu | 0:e77abf0991bf | 11 | { |
allankliu | 0:e77abf0991bf | 12 | oled.initialise(); |
allankliu | 0:e77abf0991bf | 13 | oled.clear(); |
allankliu | 0:e77abf0991bf | 14 | oled.set_contrast(255); // max contrast |
allankliu | 0:e77abf0991bf | 15 | |
allankliu | 0:e77abf0991bf | 16 | oled.set_font(bold_font, 8); |
allankliu | 0:e77abf0991bf | 17 | oled.printf("Heading\r\n"); |
allankliu | 0:e77abf0991bf | 18 | |
allankliu | 0:e77abf0991bf | 19 | oled.set_font(standard_font, 6); |
allankliu | 0:e77abf0991bf | 20 | oled.printf("Hello World!\r\n"); |
allankliu | 0:e77abf0991bf | 21 | oled.printf("Some more text here..."); |
allankliu | 0:e77abf0991bf | 22 | |
allankliu | 0:e77abf0991bf | 23 | oled.update(); |
allankliu | 0:e77abf0991bf | 24 | |
allankliu | 0:e77abf0991bf | 25 | while (1) |
allankliu | 0:e77abf0991bf | 26 | { |
allankliu | 0:e77abf0991bf | 27 | wait(2); |
allankliu | 0:e77abf0991bf | 28 | oled.scroll_up(); |
allankliu | 0:e77abf0991bf | 29 | oled.update(); |
allankliu | 0:e77abf0991bf | 30 | } |
allankliu | 0:e77abf0991bf | 31 | } |