Good Evening all,
I'm hoping you've seen this problem before on here but I can't see it anywhere so I thought I'd ask. I have a Ciseco LOL shield that I want to make scroll dynamic text; i.e. type in the serial monitor to send it to the LOL shield. The trouble is that it seems to be locking out serial comms on both an Uno and a Mega. Here's a bit of code I tried:
#include "Charliplexing.h"
#include "Font.h"
#include "Charliplexing.h"
#include "Font.h"
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
char readout[]="12345678 ";
int j=0;
boolean dunnit=false;
void setup()
{
LedSign::Init();
Serial.begin(9600);
}
void loop(){
if (dunnit==true){
while (Serial.available()){
readout[j]=Serial.read();j++;
}
for (int t=0;t<j;t++){Serial.print (readout[t]);}j=0;dunnit=false;
//for (int t=0;t<3;t++){j++;readout[j]=" ";}
}
if (dunnit==false){
showit();
}}
void showit(){
dunnit=true;
for (int8_t x=DISPLAY_COLS, i=0;; x--) {
LedSign::Clear();
for (int8_t x2=x, i2=i; x2<DISPLAY_COLS;) {
int8_t w = Font::Draw(readout[i2], x2, 0);
x2 += w, i2 = (i2+1)%strlen(readout);
if (x2 <= 0) // off the display completely?
x = x2, i = i2;
}
delay(120);
}
}
It does that "12345678" bit and displays it perfectly well scrolling to the left.
If I knock out the bit that controls the shield, the serial monitor works. When I put it back, it just won't accept any serial input. It does this on a Mega and an Uno.
I have to admit this is stumping me and it's rather annoying me too as the reason I shelled out on it was for scrolling dynamic text. I've got to be doing something wrong but I have no idea what, and if anybody knows please can you tell me because it's driven me up the wall for five hours now!
Yours hopefully,
Ian Lang.