
this program works with my pcb only
Dependencies: Adafruit_LEDBackpack mbed
Revision 0:e13c5589c250, committed 2015-05-03
- Comitter:
- sibu2
- Date:
- Sun May 03 01:18:16 2015 +0000
- Commit message:
- led matrix test
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Adafruit_LEDBackpack.lib Sun May 03 01:18:16 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/teams/Wallbot-BLE-Developer/code/Adafruit_LEDBackpack/#88646e1763c6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun May 03 01:18:16 2015 +0000 @@ -0,0 +1,50 @@ +#include "mbed.h" +#include "Adafruit_LEDBackpack.h" +#include "Adafruit_GFX.h" + +I2C i2c(p9, p10); +DigitalOut myled(LED1); + +Adafruit_8x8matrix matrix1 = Adafruit_8x8matrix(&i2c); +Adafruit_8x8matrix matrix2 = Adafruit_8x8matrix(&i2c); + +int main() { + int ledon=0; + + matrix1.begin(0x70); + matrix2.begin(0x71); + matrix1.setBrightness(15); + matrix2.setBrightness(4); + while(1) { + matrix1.clear(); + matrix2.clear(); +#if 1 + for (int y = 0; y < 8; y++) { + for (int x = 0; x < 16; x++) { + matrix1.drawPixel(x, y, LED_ON); + matrix2.drawPixel(15-x, 7-y, LED_ON); + matrix1.writeDisplay(); // write the changes we just made to the display + matrix2.writeDisplay(); // write the changes we just made to the display + wait_ms(10); + myled=(ledon^=1); + } + } + wait(1); + + for (int y = 0; y < 8; y++) { + for (int x = 0; x < 16; x++) { + matrix1.drawPixel(x, y, LED_OFF); + matrix2.drawPixel(15-x, 7-y, LED_OFF); + matrix1.writeDisplay(); // write the changes we just made to the display + matrix2.writeDisplay(); // write the changes we just made to the display + wait_ms(10); + myled=(ledon^=1); + } + } +#else + matrix1.writeDisplay(); // write the changes we just made to the display + matrix2.writeDisplay(); // write the changes we just made to the display +#endif + wait(1); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun May 03 01:18:16 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/433970e64889 \ No newline at end of file