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:2052f61477b1, 2011-07-06 (annotated)
- Committer:
- fblanc
- Date:
- Wed Jul 06 12:06:40 2011 +0000
- Revision:
- 0:2052f61477b1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
fblanc | 0:2052f61477b1 | 1 | #include "mbed.h" |
fblanc | 0:2052f61477b1 | 2 | #include "SPLC501C.h" |
fblanc | 0:2052f61477b1 | 3 | #include "graphic.h" |
fblanc | 0:2052f61477b1 | 4 | |
fblanc | 0:2052f61477b1 | 5 | int main() { |
fblanc | 0:2052f61477b1 | 6 | |
fblanc | 0:2052f61477b1 | 7 | GLCD_Initialize(); //init |
fblanc | 0:2052f61477b1 | 8 | wait(0.1); |
fblanc | 0:2052f61477b1 | 9 | GLCD_ClearScreen(); //clear |
fblanc | 0:2052f61477b1 | 10 | |
fblanc | 0:2052f61477b1 | 11 | char str[10]="Bonjour"; |
fblanc | 0:2052f61477b1 | 12 | str[9]=0; |
fblanc | 0:2052f61477b1 | 13 | GLCD_GoTo(10,0); // |
fblanc | 0:2052f61477b1 | 14 | GLCD_WriteString10x16(str); //print font 10x16 |
fblanc | 0:2052f61477b1 | 15 | GLCD_GoTo(10,3); |
fblanc | 0:2052f61477b1 | 16 | GLCD_WriteString5x7(str); //print font 5x7 |
fblanc | 0:2052f61477b1 | 17 | |
fblanc | 0:2052f61477b1 | 18 | unsigned char i=0; |
fblanc | 0:2052f61477b1 | 19 | unsigned char r=5; |
fblanc | 0:2052f61477b1 | 20 | while (1) { |
fblanc | 0:2052f61477b1 | 21 | GLCD_GoTo(10,6); |
fblanc | 0:2052f61477b1 | 22 | sprintf(str,"%d ",i++); |
fblanc | 0:2052f61477b1 | 23 | GLCD_WriteString10x16(str); |
fblanc | 0:2052f61477b1 | 24 | for(char j=0;j<5;j++) |
fblanc | 0:2052f61477b1 | 25 | { |
fblanc | 0:2052f61477b1 | 26 | GLCD_Circle(64, 30 ,r+j,1); |
fblanc | 0:2052f61477b1 | 27 | GLCD_Circle(64, 30 ,r-j,0); |
fblanc | 0:2052f61477b1 | 28 | } |
fblanc | 0:2052f61477b1 | 29 | r+=5; |
fblanc | 0:2052f61477b1 | 30 | wait(0.5); |
fblanc | 0:2052f61477b1 | 31 | if (r>25) |
fblanc | 0:2052f61477b1 | 32 | { |
fblanc | 0:2052f61477b1 | 33 | GLCD_ClearScreen(); |
fblanc | 0:2052f61477b1 | 34 | r=5; |
fblanc | 0:2052f61477b1 | 35 | } |
fblanc | 0:2052f61477b1 | 36 | } |
fblanc | 0:2052f61477b1 | 37 | } |
fblanc | 0:2052f61477b1 | 38 |