Example application for two 16x8 Adafruit LED Backpacks to make a 32 x 8 matrix.
Dependencies: Adafruit_32x8matrix
Fork of Adafruit_LEDBackpack_16x8_App by
This project uses two 16x8 1.2" LED Matrix + Backpacks stuck together to make a 32x8 double-length matrix.
Revision 8:5f5ceafa826d, committed 2017-12-11
- Comitter:
- maclobdell
- Date:
- Mon Dec 11 19:23:47 2017 +0000
- Parent:
- 7:1bd79d71396a
- Commit message:
- updated to demonstrate new playText function which parses through a sentence and either shows or scrolls each word depending on the size
Changed in this revision
diff -r 1bd79d71396a -r 5f5ceafa826d Adafruit_32x8matrix.lib --- a/Adafruit_32x8matrix.lib Wed Jun 28 19:44:15 2017 +0000 +++ b/Adafruit_32x8matrix.lib Mon Dec 11 19:23:47 2017 +0000 @@ -1,1 +1,1 @@ -https://developer.mbed.org/users/maclobdell/code/Adafruit_32x8matrix/#acc3c726ffe3 +https://developer.mbed.org/users/maclobdell/code/Adafruit_32x8matrix/#cdcd2d7d83c3
diff -r 1bd79d71396a -r 5f5ceafa826d main.cpp --- a/main.cpp Wed Jun 28 19:44:15 2017 +0000 +++ b/main.cpp Mon Dec 11 19:23:47 2017 +0000 @@ -1,56 +1,42 @@ +/* + * Copyright (c) 2016 ARM Limited. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + #include "mbed.h" #include "Adafruit_32x8matrix.h" - + #define I2C_ADDR1 0x70 #define I2C_ADDR2 0x71 #define ROTATION1 0 #define ROTATION2 2 #define BRIGHTNESS 1 - -Serial pc (USBTX,USBRX); - -void myidlethread(void); - + I2C i2c(D14, D15); - + Adafruit_32x8matrix matrix(&i2c, I2C_ADDR1, I2C_ADDR2, ROTATION1, ROTATION2, BRIGHTNESS); - + int main() { - - char buffer [50]; - - Thread::attach_idle_hook(myidlethread); + char buffer [50]; - sprintf(buffer, "This\0"); - matrix.showText(buffer,strlen(buffer), 1); - - sprintf(buffer, "is\0"); - matrix.showText(buffer,strlen(buffer), 1); - - sprintf(buffer, "the\0"); - matrix.showText(buffer,strlen(buffer), 1); - - sprintf (buffer, "IoT Lab\0"); - matrix.scrollText(buffer,strlen(buffer), 100); - - Thread::wait(1000); - - sprintf(buffer, "Welcome\0"); - - while(1) - { - matrix.scrollText(buffer,strlen(buffer), 80); - + while(1) + { + snprintf(buffer, 50, "Hi, how are you today?\0"); //pass in max chars to prevent overflow + matrix.playText(buffer,strlen(buffer), 1); + Thread::wait(10000); } - + } - -void myidlethread(void) -{ - sleep(); //go to sleep, wait for an interrupt - -} - -
diff -r 1bd79d71396a -r 5f5ceafa826d mbed-os.lib --- a/mbed-os.lib Wed Jun 28 19:44:15 2017 +0000 +++ b/mbed-os.lib Mon Dec 11 19:23:47 2017 +0000 @@ -1,1 +1,1 @@ -https://github.com/armmbed/mbed-os/#532da7133f7d51db958eacb2b5f13e7cf7feb81f +https://github.com/armmbed/mbed-os/#5f6572179d66ce4c09d6517b659ac51133cc980d