Sending time AI2 via Bluetooth to Arduino Micro

Hi Guys,

At the moment im hopelessly stuck. It literally keeps me awake at night. I hope you might be able to help me out a bit.

What i want is this: I want to send time with a smartphone to my arduino Micro (HC-06 bluetooth module hooked up). (eventually also colorcodes (R G B).) I don't really care if you can only send the systemtime of the smartphone or if you can pick it manually (time picker) and send it to the arduino (DS3231 module).

For the past few days i googled whole of the interwebz but couldnt find anything that gave me that Eureka moment.

my idea is to fetch system time in the app, send it as String (but as an array: HH,MM,SS). I dont know if SoftwareSerial is able to read this (mySerial.readString i guess?). And then somehow convert it to 3 seperate int's (H = (first in the array), M = (second in the array), etc.

Your help is really appreciated!!

Kind regards, Tymen

ps. if someone has an even better idea (or if there is something on the internet that looks like what i want) feel free to share.

send it as String (but as an array: HH,MM,SS)

That does not make sense. You either want to send the data as a bunch of letters OR you want to send binary data that may, or may not, have come from an array.

If you are using an RTC (DS3231 module), why do you need to send time to the Arduino?

PaulS: That does not make sense. You either want to send the data as a bunch of letters OR you want to send binary data that may, or may not, have come from an array.

If you are using an RTC (DS3231 module), why do you need to send time to the Arduino?

hi paul,

when the time changes (like daylights saving time), or when the batt died in de RTC, i want to be able to set time using my phone.

the main thing im stuck with is, how can i get different intergers out of one what i set via bluetooth.

for example i set HH,MM,SS (15,12,12) as a string to my arduino. how can i get split these up in induvidual intergers ( for example: string=15,12,12 > H=15, M=12 and S=12).

like i said in OP, if someone knows a better way, please let me know

Have you looked at strtok() or sscanf()?