Guys I need help. I posted a similar problem a few months ago, and thanks to all those who spared me time. I need help, now how do I send STX, ETX and joystick coordinates to the arduino? I did some reading but I was not able to get anywhere with it. So I found this ino code on arduino.cc forum and I actually got it to work, of course I used an android app from playstore. But the problem is I need to create my own android app, I need it to control my pan/tilt servos. I browsed in app inventor forum and I was wondering if that 'sendBytes.png' I found somewhere on this forum will work.
I attached it. Thanks a lot in advance. I owe you one hehe help me out XD Kudos! Ghica 22.1.17.
How to debug things: In addition to sending numbers to the BT device, add some UI elements to your phone screen and display the numbers you are trying to send there. I have some comments on your code: - The clock you have is a dangerous thing and I do not see why you would need it. Your AfterPicking, in the then part would be better if would set the label1 with green color - Add a disconnect button.
having both 'when Dragged' and 'when TouchUp' may interfere in unexpected ways and you seem to do the same thing for both. Delete one of them.
And now the BT device: install an App that can send data to your device and try to find out what data you should send to make your device move. It may be different from what you think. Also, you could try to send some data back, to see in the app what happens. Yes, you need a clock then to find out if there is data to recieve.
Cheers, Ghica. Thenewbie 25.1.17. Joystick: fine, but do you need to send these values to the BT device too? Baudrate: this depends on what your device can handle. And, because you are waiting a second in each loop iteration, it does not make sense.
Which brings me back to App Inventor: thinking about it, yes, you need a clock and you should only send data to your BT device to every clock tick. Also, the time interval should be higher that the delay in you loop on the BT device. Because your device will not be able to keep up with all the messages and choke. (Do not even think of building a delay in APp Inventor, that will crash your app. Search the forum) Now, before you are making too many changes: Make sure the values you send are right and make sure that your device operates in the right way, because I doubt that too.
Because as far as I can see in your last.ino snippet you never send anything to the servo. Cheers, Ghica. Thenewbie 26.1.17.