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.
Fork of ledmatrix02 by
main.cpp@1:eb9338579a76, 2015-12-23 (annotated)
- Committer:
- mbed_Cookbook_SE
- Date:
- Wed Dec 23 16:02:40 2015 +0000
- Revision:
- 1:eb9338579a76
- Parent:
- 0:e13c5589c250
??
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| sibu2 | 0:e13c5589c250 | 1 | #include "mbed.h" |
| mbed_Cookbook_SE | 1:eb9338579a76 | 2 | #include "LedPanel.h" |
| mbed_Cookbook_SE | 1:eb9338579a76 | 3 | #include "LedPanel_GFX.h" |
| sibu2 | 0:e13c5589c250 | 4 | |
| sibu2 | 0:e13c5589c250 | 5 | I2C i2c(p9, p10); |
| sibu2 | 0:e13c5589c250 | 6 | DigitalOut myled(LED1); |
| mbed_Cookbook_SE | 1:eb9338579a76 | 7 | LocalFileSystem local("local"); |
| sibu2 | 0:e13c5589c250 | 8 | |
| mbed_Cookbook_SE | 1:eb9338579a76 | 9 | LedPanel matrix(&i2c); |
| sibu2 | 0:e13c5589c250 | 10 | |
| sibu2 | 0:e13c5589c250 | 11 | int main() { |
| mbed_Cookbook_SE | 1:eb9338579a76 | 12 | char text[10]; |
| mbed_Cookbook_SE | 1:eb9338579a76 | 13 | |
| mbed_Cookbook_SE | 1:eb9338579a76 | 14 | FILE *fp = fopen("/local/text.txt", "r"); |
| mbed_Cookbook_SE | 1:eb9338579a76 | 15 | |
| mbed_Cookbook_SE | 1:eb9338579a76 | 16 | fgets(text,10,fp); |
| sibu2 | 0:e13c5589c250 | 17 | |
| mbed_Cookbook_SE | 1:eb9338579a76 | 18 | fclose(fp); |
| mbed_Cookbook_SE | 1:eb9338579a76 | 19 | |
| mbed_Cookbook_SE | 1:eb9338579a76 | 20 | matrix.begin(0x70,0x71); |
| mbed_Cookbook_SE | 1:eb9338579a76 | 21 | matrix.setBrightness(1); |
| mbed_Cookbook_SE | 1:eb9338579a76 | 22 | |
| sibu2 | 0:e13c5589c250 | 23 | while(1) { |
| mbed_Cookbook_SE | 1:eb9338579a76 | 24 | matrix.setCursor(0,0); |
| mbed_Cookbook_SE | 1:eb9338579a76 | 25 | matrix.printf("%s",text); |
| mbed_Cookbook_SE | 1:eb9338579a76 | 26 | matrix.writeDisplay(); |
| mbed_Cookbook_SE | 1:eb9338579a76 | 27 | wait(2); |
| sibu2 | 0:e13c5589c250 | 28 | } |
| sibu2 | 0:e13c5589c250 | 29 | } |
