Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Charliplexing.h>
- #include <Figure.h>
- #include <Font.h>
- void setup() {
- Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
- LedSign::Init(); //LolShield init
- }
- char inChar; // Where to store the character read
- int index = 0; // Index into array; where to store the character
- char scrollText[150] = {' '}; // Allocate some space for the string
- void loop() {
- while (Serial.available() > 0) { // Check for incoming Serial Data
- inChar = Serial.read(); // Read a character
- if (inChar == '~' | index == 149){
- scrollText[index] = '\0';
- break;
- }
- scrollText[index] = inChar;
- index++;
- }
- //part below copypasted direct from LoLShield_FontTest and except with array name changed
- int8_t x=0,x2=0;
- for(int8_t j=13;j>-100;j--) {
- x=j;
- LedSign::Clear();
- for(int i=0;i<150;i++) {
- if (scrollText[i] == '\0') break;
- x2=Font::Draw(scrollText[i],x,0);
- x+=x2;
- if (x>=13) break;
- }
- delay(60);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement