Android : is Arduino bluetooth instruction will create Memory issue in Android device?

on Monday, March 23, 2015


I am trying to create one sample Piano board using Arduino UNO and Code. The piano board will send music Notes to Android table , so in the tablet app the notes music will play. But i have one issue while sending data from Arduino board using bluetooth module to Android tablet.


Issue is , i have created some conditional statement which will send Bluetooth instruction as per the condition satisfied. But when i am not pressing any button in the board then also in the else part i am sending Serial.println("") means no data to the app. But i am wondering as in the else still the board is sending instruction , which is continuous task , so will it create any Memory issue , Performance issue to the tablet app. So , please go through my Arduino Code.


My Code :



#include <Button.h>

/*Piano Buttons*/
Button pBtn1 = Button(2,PULLUP);
Button pBtn2 = Button(3,PULLUP);
Button pBtn3 = Button(4,PULLUP);
Button pBtn4 = Button(5,PULLUP);
Button pBtn5 = Button(6,PULLUP);
Button pBtn6 = Button(7,PULLUP);
Button pBtn7 = Button(8,PULLUP);
Button pBtn8 = Button(9,PULLUP);
Button pBtn9 = Button(10,PULLUP);
Button pBtn10 = Button(11,PULLUP);
Button pBtn11 = Button(12,PULLUP);
Button pBtn12 = Button(13,PULLUP);


void setup(){
Serial.begin(9600);
}

void loop(){
if(pBtn1.isPressed()){
Serial.println("a");
}
else if(pBtn2.isPressed()){
Serial.println("b");
}
else if(pBtn3.isPressed()){
Serial.println("c");
}
else if(pBtn4.isPressed()){
Serial.println("d");
}
else if(pBtn5.isPressed()){
Serial.println("e");
}
else if(pBtn6.isPressed()){
Serial.println("f");
}
else if(pBtn7.isPressed()){
Serial.println("g");
}
else if(pBtn8.isPressed()){
Serial.println("h");
}
else if(pBtn9.isPressed()){
Serial.println("i");
}
else if(pBtn10.isPressed()){
Serial.println("j");
}
else if(pBtn11.isPressed()){
Serial.println("k");
}
else if(pBtn12.isPressed()){
Serial.println("l");
}
else{
Serial.println("");
} }


So , this is the above Arduino Code. Please go through it and suggest me some good solution.


0 comments:

Post a Comment