Clock Shield acts as Arduino Shield via 1Sheeld

Buy 1Sheeld
Clock Shield acts as Arduino Shield via 1Sheeld

Buy 1Sheeld

Get the time using a few lines in your sketch to trigger any hardware action.

This shield is one of the special shields. Special shields allows your Arduino board to use some capabilities your smartphone can do, like playing music, taking a picture, getting notifications, accessing the clock data and using the touch screen for various functions.Learn more from the special shields tutorial.

Clock  library allows your Arduino board to get the time from the smartphone and take actions within certain time set in the sketch.

Adding #define CUSTOM_SETTINGS along with #define INCLUDE_CLOCK_SHIELD is a key that will let you unlock the Clock shield only amongst all shields and prevent 1Sheeld library from eating your memory specially for UNO board.

void queryDateAndTime(void)

Sends a request to 1Sheeld application to get date and time information. (Mandatory)

Note

There are three different ways to get time and date from the application:

– Stating”queryDateAndTime” in the setup function and when you upload the sketch to your board the request is sent but you have the UART switch opened “uploading mode” which then all the data in the setup function will not reach to the application to do the process.

Solution: After you successfully upload the sketch close the UART switch “operating mode” then press the UNO’s reset button again.

– Stating”queryDateAndTime” in the loop .. it will work like charm ….! But if you are working on an application that requires high data transfer between the application and your UNO so it’s not preferable as there will be a lot of unwanted requests by the function which the application already got informed of.

– Not stating “queryDateAndTime” but after you already uploaded the sketch close the UART switch “operating mode” then choose the clock shield from the application which by that it will send the updated data to your UNO so that your board can save them into your sketch and do some actions.

SYNTAX
Clock.queryDateAndTime();

RETURNS
None.

PARAMETERS
None.

USAGE
Clock.queryDateAndTime();

 

byte getSeconds(void)

Receives seconds from the application.

SYNTAX
Clock.getSeconds( );

RETURNS
Returns a byte holding the seconds.

PARAMETERS
None.

USAGE
byte seconds = Clock.getSeconds();

 

byte getMinutes(void)

Receives minutes from the application.

SYNTAX
Clock.getMinutes( );

RETURNS
Returns a byte holding the minutes.

PARAMETERS
None.

USAGE
byte minutes = Clock.getMinutes();

 

byte getHours(void)

Receives hours from the application.

SYNTAX
Clock.getHours( );

RETURNS
Returns a byte holding the hours.

PARAMETERS
None.

USAGE
byte hours = Clock.getHours();

 

byte getDay(void)

Receives day numner from the application.

SYNTAX
Clock.getDay( );

RETURNS
Returns a byte holding the day number.

PARAMETERS
None.

USAGE
byte day = Clock.getDay();

 

byte getMonth(void)

Receives month numner from the application.

SYNTAX
Clock.getMonth( );

RETURNS
Returns a byte holding the month number.

PARAMETERS
None.

USAGE
byte month = Clock.getMonth();

 

short getYear(void)

Receives year from the application.

SYNTAX
Clock.getYear( );

RETURNS
Returns a short integer holding the year.

PARAMETERS
None.

USAGE
short year = Clock.getYear();