64*16 Red LED Matrix with Bluetooth

Hello all,
I'm working on a little message sign to put in my oldtimer Police Car.
Untill now eveything works, just 1 little problem.
When I send the message over Bluetooth, then the message is displayed, but only ones.
This would be shown over and over again untill I do send "StopScrolling" over the Bluetooth.
Who can help me with this?

This is the part of the Bluetooth :
void BT(){
int i = 0;
int m = 0;
delay(500);
if (Serial.available() > 0) {
while (Serial.available() > 0) {
inSerial*=Serial.read();*

  • i++;*
  • }*
    _ inSerial*='\0';_
    Check_Protocol(inSerial);
    _
    } _
    _
    }_
    void Check_Protocol(char inStr[]){
    _
    int i=0;_
    _
    int m=0;_
    _
    Serial.println(inStr);*_

* if(!strcmp(inStr,"SendStop")){ //STOP*
* display.clear();*
* showStop();;*
* Serial.println("Stop");*
* for(m=0;m<11;m++){*
* inStr[m]=0;*
* }*
* i=0;*
* }*

* if(!strcmp(inStr,"StopScrolling")){ //Display uit*
* display.clear();*
* Serial.println("Display OFF");*
* for(m=0;m<11;m++){*
* inStr[m]=0;*
* }*
* i=0;*
* }*

* if(!strcmp(inStr,"SendStopPolitie")){ //Display uit*
* display.clear();*
* showStopPolitie();*
* Serial.println("Stop Politie");*
* for(m=0;m<11;m++){*
* inStr[m]=0;*
* }*
* i=0;*
* }*
* else{*
* for(m=0;m<11;m++){*
* inStr[m]=0;*
* }*
* i=0;*
* }*
}
Teskstbord_DMD_STOP_64x16_BT.ino (8.34 KB)

OK, first things first.

You need to go and read the forum instructions so that you can go back and modify your original post (not re-post it) - using the "More -> Modify" option below the right hand corner of your post - to mark up your code as such using the "</>" icon in the posting window. Just highlight each section of code (or output if you later need to post that) from the IDE and click the icon.

In fact, the IDE itself has a "copy for forum" link to put these markings on a highlighted block for you so you then just paste it here in a posting window. But even before doing that, don't forget to use the "Auto-Format" (Ctrl-T) option first to make it easy to read. If you do not post it as "code" it can as you now see, easily be quite garbled and is always more difficult to read due to the font.

It is inappropriate to attach it as a ".ino" file unless it is clearly too long to include in the post proper. People can usually see the mistakes directly and do not want to have to actually load it in their own IDE. And even that would also assume they are using a PC and have the IDE running on that PC.

And of course, keep your blank space tidy (yours is OK). Do use blank lines, but only single blanks between complete functional blocks.

Why do we think this is more important than just having your question answered? Because it is really difficult to write code properly - as with any other task requiring care - if everything is disorganised!

This topic was automatically closed after 120 days. New replies are no longer allowed.