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.
Dependencies: TextLCD mbed SDFileSystem
main.cpp@0:bd60a27d6122, 2011-05-07 (annotated)
- Committer:
- yueee_yt
- Date:
- Sat May 07 12:11:13 2011 +0000
- Revision:
- 0:bd60a27d6122
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| yueee_yt | 0:bd60a27d6122 | 1 | #include "mbed.h" |
| yueee_yt | 0:bd60a27d6122 | 2 | #include "TextLCD.h" |
| yueee_yt | 0:bd60a27d6122 | 3 | #include "SDFileSystem.h" |
| yueee_yt | 0:bd60a27d6122 | 4 | |
| yueee_yt | 0:bd60a27d6122 | 5 | TextLCD lcd(p24, p26, p27, p28, p29, p30); |
| yueee_yt | 0:bd60a27d6122 | 6 | SDFileSystem sd(p5, p6, p7, p8, "sd"); |
| yueee_yt | 0:bd60a27d6122 | 7 | |
| yueee_yt | 0:bd60a27d6122 | 8 | int main(void) { |
| yueee_yt | 0:bd60a27d6122 | 9 | DIR *d; |
| yueee_yt | 0:bd60a27d6122 | 10 | struct dirent *p; |
| yueee_yt | 0:bd60a27d6122 | 11 | lcd.cls(); |
| yueee_yt | 0:bd60a27d6122 | 12 | d = opendir("/sd"); |
| yueee_yt | 0:bd60a27d6122 | 13 | if ( d != NULL ) |
| yueee_yt | 0:bd60a27d6122 | 14 | { |
| yueee_yt | 0:bd60a27d6122 | 15 | while ( (p = readdir(d)) != NULL ) |
| yueee_yt | 0:bd60a27d6122 | 16 | { |
| yueee_yt | 0:bd60a27d6122 | 17 | lcd.printf("%s \n", p->d_name); |
| yueee_yt | 0:bd60a27d6122 | 18 | wait(0.5); |
| yueee_yt | 0:bd60a27d6122 | 19 | } |
| yueee_yt | 0:bd60a27d6122 | 20 | } |
| yueee_yt | 0:bd60a27d6122 | 21 | lcd.locate(0,1); |
| yueee_yt | 0:bd60a27d6122 | 22 | lcd.printf("** Finish ** "); |
| yueee_yt | 0:bd60a27d6122 | 23 | return 0; |
| yueee_yt | 0:bd60a27d6122 | 24 | } |