Dear @MasterfulMatthew,
nice to see that you have used (approx.) my algorithm.
Most probably the notification contains the \n (ASCII Linefeed: 0x0A or 10 decimal) character that stops the receiving when encountered by the readstring(). But the modified algorithm retries to get new data as they are still incoming, so, by repeating the readstring() until BTserial.avaialble is true, deosn't interrupt the received sentence. And in this case you don't need the delayMicroseconds.
Good job !
That's a point. Char[x]
string uses less memory than String
. Also, 'val' could be populated by Serial.readStringUntil()
, with an imposed end of string character. The target though should be to update the Serial Monitor with short strings, so I'm thinking that would be easiest to achieve if the App sent short strings.
Isn't this pretty much the same as before?
val += BTserial.readString();
val becomes one long string that could exceed the Serial Monitor buffer limit?
Another thing of interest, about which I know nothing, is the OLED display - is there a maximum number of characters it can display or does the first part of a message roll off, to be replaced by the next part, like a typewriter?
using BTserial.read() gave me ASCII numbers, that's why I altered your suggested code. But hey, you were to spark to solving it.
I'm already almost done making a scroll function. I'm going to make a full Youtube tutorial and blogpost somewhere (not sure what platform yet), but I'm going to share all my experiences, issues, solutions and workarounds.
Dear @MasterfulMatthew,
thanks for sharing this detail ! Honestly I didn't try my hypotesis of solution on a real HW, but the way to receive long messages on the BT that I've suggested you is the same that I've used many times. The weird thing is that the issue of receiving numbers (the ASCII codes) instead of true characters does never happened to me.
Anyway, I'm happy that it works for you with the readstrng !!!
Cheers.
Everything works on all chatting platforms! This setup will work with ANY notification. If anyone has this problem or wants to display phone notifications on an OLED display via a Bluetooth module and Arduino Pro Micro, simply follow this forum. You could use this for say, a pair of smart glasses or a smart watch. If anything is unclear, please contact me directly!
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.