I can't seem to know how to build it. Basically, I'm planning to have arduino send something such as certain value or bytes, it'll be a loop which checks if...
Let's say:
BT module sends A = 1 or 0 to the app. Now app that has a while loop which checks
while (true) {
if BT sends A = 1 {
Title:OPEN visibility = true
Title:CLOSED visibility = false
break loop
}
else if BT sends A = 0 {
Title:CLOSED visibility = true
Title:OPEN visibility = false
break loop
}
Print: Error, either BT failed to send or A is neither 1 or 0.
}
I'm having a difficult understanding on bluetooth and I just don't know if it's possible on MIT App Inventor. Please help, I appreciate all the help.
I'm sorry if I'm asking too much. I'm still not home and I didn't bring my build so if you have time, can I get confirmation if what I did is correct? Also thank you for your help!
I might be asking at the wrong site, but is this code in arduino is good? I tried making it shorter but I can't:
while (BTComm.available()) {
if (c <= 10) {
BTSerial.println("A=1");
break;
}
else if (c = 90) {
BTSerial.println("A=0");
break;
}