Shields
/
mbed_Shield_LCD
Example program with the LCD display of the mbed application shield.
main.cpp@3:12965b28af04, 2014-07-25 (annotated)
- Committer:
- screamer
- Date:
- Fri Jul 25 12:31:49 2014 +0000
- Revision:
- 3:12965b28af04
- Parent:
- 0:4249e647c629
Add Apache2 license compatible header
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
screamer | 3:12965b28af04 | 1 | /* Copyright (c) 2010-2011 mbed.org, MIT License |
screamer | 3:12965b28af04 | 2 | * |
screamer | 3:12965b28af04 | 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
screamer | 3:12965b28af04 | 4 | * and associated documentation files (the "Software"), to deal in the Software without |
screamer | 3:12965b28af04 | 5 | * restriction, including without limitation the rights to use, copy, modify, merge, publish, |
screamer | 3:12965b28af04 | 6 | * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the |
screamer | 3:12965b28af04 | 7 | * Software is furnished to do so, subject to the following conditions: |
screamer | 3:12965b28af04 | 8 | * |
screamer | 3:12965b28af04 | 9 | * The above copyright notice and this permission notice shall be included in all copies or |
screamer | 3:12965b28af04 | 10 | * substantial portions of the Software. |
screamer | 3:12965b28af04 | 11 | * |
screamer | 3:12965b28af04 | 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
screamer | 3:12965b28af04 | 13 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
screamer | 3:12965b28af04 | 14 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
screamer | 3:12965b28af04 | 15 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
screamer | 3:12965b28af04 | 16 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
screamer | 3:12965b28af04 | 17 | */ |
screamer | 3:12965b28af04 | 18 | |
screamer | 0:4249e647c629 | 19 | #include "mbed.h" |
screamer | 0:4249e647c629 | 20 | #include "C12832.h" |
screamer | 0:4249e647c629 | 21 | |
screamer | 0:4249e647c629 | 22 | C12832 lcd(D11, D13, D12, D7, D10); |
screamer | 0:4249e647c629 | 23 | |
screamer | 0:4249e647c629 | 24 | int main() |
screamer | 0:4249e647c629 | 25 | { |
screamer | 0:4249e647c629 | 26 | // clear the screen |
screamer | 0:4249e647c629 | 27 | lcd.cls(); |
screamer | 0:4249e647c629 | 28 | |
screamer | 0:4249e647c629 | 29 | // print the first line and wait 3 sec |
screamer | 0:4249e647c629 | 30 | lcd.locate(0,3); |
screamer | 0:4249e647c629 | 31 | lcd.printf("mbed application board!"); |
screamer | 3:12965b28af04 | 32 | |
screamer | 0:4249e647c629 | 33 | // print the counter prefix; the number will be printed in the while loop |
screamer | 0:4249e647c629 | 34 | lcd.locate(0,15); |
screamer | 0:4249e647c629 | 35 | lcd.printf("Counting:"); |
screamer | 0:4249e647c629 | 36 | |
screamer | 0:4249e647c629 | 37 | int i=1; |
screamer | 0:4249e647c629 | 38 | while(i++) { |
screamer | 0:4249e647c629 | 39 | lcd.locate(42,15); |
screamer | 0:4249e647c629 | 40 | lcd.printf("%d", i); |
screamer | 0:4249e647c629 | 41 | wait(0.01); |
screamer | 0:4249e647c629 | 42 | } |
screamer | 0:4249e647c629 | 43 | } |