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: Adafruit_32x8matrix
main.cpp@0:2eec8a9428ea, 2016-12-15 (annotated)
- Committer:
- maclobdell
- Date:
- Thu Dec 15 17:43:32 2016 +0000
- Revision:
- 0:2eec8a9428ea
- Child:
- 1:dd1d1b64b9a5
Example application for 16x8 Adafruit LED Backpack.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| maclobdell | 0:2eec8a9428ea | 1 | #include "mbed.h" |
| maclobdell | 0:2eec8a9428ea | 2 | #include "Adafruit_LEDBackpack.h" |
| maclobdell | 0:2eec8a9428ea | 3 | #include "Adafruit_GFX.h" |
| maclobdell | 0:2eec8a9428ea | 4 | |
| maclobdell | 0:2eec8a9428ea | 5 | I2C i2c(D14, D15); |
| maclobdell | 0:2eec8a9428ea | 6 | |
| maclobdell | 0:2eec8a9428ea | 7 | Adafruit_16x8matrix matrix = Adafruit_16x8matrix(&i2c); |
| maclobdell | 0:2eec8a9428ea | 8 | |
| maclobdell | 0:2eec8a9428ea | 9 | int main() { |
| maclobdell | 0:2eec8a9428ea | 10 | matrix.begin(0x70); |
| maclobdell | 0:2eec8a9428ea | 11 | while(1) { |
| maclobdell | 0:2eec8a9428ea | 12 | matrix.clear(); |
| maclobdell | 0:2eec8a9428ea | 13 | for (int i = 0; i < 16; i++) { |
| maclobdell | 0:2eec8a9428ea | 14 | for (int j = 0; j < 16; j++) { |
| maclobdell | 0:2eec8a9428ea | 15 | matrix.drawPixel(i, j, LED_ON); |
| maclobdell | 0:2eec8a9428ea | 16 | matrix.writeDisplay(); // write the changes we just made to the display |
| maclobdell | 0:2eec8a9428ea | 17 | Thread::wait(100); |
| maclobdell | 0:2eec8a9428ea | 18 | } |
| maclobdell | 0:2eec8a9428ea | 19 | } |
| maclobdell | 0:2eec8a9428ea | 20 | } |
| maclobdell | 0:2eec8a9428ea | 21 | } |