Hello I'd like to how to proceed to make a clock itself on Arduino Micro. The clock start time will be given by Android App in millscnd.
I have one micro pro with Oled Display and bluetooth, I need make the clock run itself, and when I not have data in bluetooth serial I'll display in OLED.
After modifier I have : 1569794158119, but I´m how I can build this thread in Arduino.
This looks like a standard unix time stamp with milliseconds. Is it a local time, or GMT? Once your receive the transmission on the Arduino it is going to be simple to convert the character string time stamp to an unsigned long number and convert that to HH:MM:SS. The Time Library may prove useful.
First, I would suggest that you read Robin2's excellent tutorial on Serial Input Basics.
It looks like you have a unique start marker ':'
Is the transmitted millisecond string terminated with a new line or carriage return?
The Arduino micro has a hardware Serial1 separate from the usb serial. You can use this for the bluetooth connections.
lakesidepark22:
After modifier I have : 1569794158119, but I´m how I can build this thread in Arduino.
That looks like a UNIX time stamp indeed.
Ignore the last three characters (or send timestamp in seconds); convert the resulting string into a 32-bit unsigned int, and then use that to set your local time using the Time library and retrieve hours/minutes/seconds using the built-in formulas:
timeSet(timestamp);
hh = hours();
mm = minutes();
ss = seconds();
You may have to add your timezone offset to the timestamp, depending on whether you get local time or UTC from your Android.