Hello,
Looking since hours to find a solution, i did a android app with app inventor to be able to communicate with bluetooth to my Arduino with a HC-06, all work fine for the communication.
In my app i have a one button and one slider.
The button send a state of 1 or 0 when click, message send to Arduino is : button=1 or button=0
That easy and work perfect.
But the slider is the issue, it send a value from 0 et 100 depending of the position, so he send "slider=x" x is the number of the slider position between 0 and 100, the Arduino receive it with no problem, but then i don't know how to take only the value after the = and use it.
Here the part of the code :
if(message=="button=1"){ // If message is button=1 then modeAM=1
modeAM=1;
Serial1.println("ModeAM=1");
}
else if (message=="modeam=0"){ // If message is button=1 then modeAM=0
modeAM=0;
Serial1.println("ModeAM=0");
}
That the part for the button that work fine not what need to do for the slider.
if (message=="slider=value_of_the_slider"){ // If message is slider=slider=value_of_the_slider then SliderP=slider=value_of_the_slider
SliderP=value_of_the_slider;
Serial1.println("Slider=value_of_the_slider");
}
So you can see i need to be able to take the value_of_the_slider only and say SliderP=value_of_the_slider
But i can't find the right way to do it, can anybody help me ?
Thanks a lot