i paired from my device
@svan I have data printing in the console window! I recognise the text but the protocol is different from yours, not a problem, easily fixed.
262,
*
P
1
[/quote]
on bluethooth ?
Yes, BlueTooth, Iām altering the program so it prints on the phone as well.
Iām leaving for work tomorrow morning okay for Wednesday ok.
now i see some for the hc-06 then i go to bed
now thanks night
si funziona!!! via bluetooth legge lāencoder!!!
Hi @svan, Iāve been adjusting your program, learning whatās there and making it auto-connect to an Arduino+HC05 of mine. A few comments:
-
Whatever I did with the baud control didnāt make any difference. So I deleted all the ābaudā items and code, and it works as well as before. I think there is no baud rate on a BT link.
-
Where your program reads the incoming bytes I added āif availableā and a delay while nothing has arrived. Another delay before reading to ensure I get the whole line as sent.
if (mmInStream.available() > 60)
{
delay(200); // allow the rest of the line to arrive
bytes = mmInStream.read(buffer);
String inStr = new String(buffer, 0, bytes);
print(inStr);
dataStr = dataStr + inStr;
// To do - interpret the arrived string into values
}
else
{
// if nothing arrived, wait a moment.
delay(100);
}
That print(inStr) actually does a println(inStr) on the console. Never mind, itās pretty amazing that you can have a console on the PC from a program running in the phone.
- Building the program is quite slow, 90 seconds to compile and run.
Anyway, itās awesome as they say, another really useful tool to connect things, thanks again.
Thank you for taking the time to look at the code and for your constructive comments. The feedback is much appreciated.
- Building the program is quite slow, 90 seconds to compile and run.
Noel swears by APDE to make code compile faster (he uses a PC). Iām using a Mac and it has never worked that well for me (likely because I donāt know how to use it). It possibly could help you if you havenāt already tried it.
I want to make clear that I use a PC only for editing the pde file.
I use in conjunction an app on my phone and a chrome extension both called Pigeon, that share the clipboard content from both phone and PC. So, in no time, just by copying and pasting the clipboard, I can run my sketch on my phone with the APDE app in 4, 5 seconds. (If in preview mode). There are similar clipboard apps, and also for Mac & Android like Alt-C.