I'm making a project in which a BLE HM-10 is sending a string of text to an Arduino. All is working fine when sending the string via serial monitor or the DSD Tech app for Android to the Arduino.
The string sent from app is: "01,10,01,10,01,10,01,10,01,10,01,10,"
When received at Arduino it becomes: "01,10,01,10,01,10,01,2277,2277,2277,2277,2277,"
I have tried to input "values" with both "text" and "join". Same issue.
I'm using BLE extension "Build 20181124" and "Call BLE WriteStrings".
Thanks in advance. Regards, Kasper.
A piece of the code (sorry for it being in danish, but you get the point )
if (Serial.available()) {
for (int dispenser = 0; dispenser < antalDispenser; dispenser++){
for (int parameter = 0; parameter < parameterDispenser; parameter++){
for (int parameterTal = 0; parameterTal < parameterLaengde; parameterTal++){
if (Serial.available()) {
serielTal = Serial.read();
serielTal = serielTal - 48;
samletTal = samletTal * 10 + serielTal;
} else {
delay(500);
serielTal = Serial.read();
serielTal = serielTal - 48;
samletTal = samletTal * 10 + serielTal;
}
}
mixerArray[dispenser][parameter] = samletTal;
samletTal = 0; // Ryd til næste tal
serielTal = Serial.read();
}
}