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.

Learn more from the examples page.

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)

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

1) 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.

2) 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.

3) 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();

Receives seconds from the application.

SYNTAX

Clock.getSeconds( );

RETURNS

Seconds in byte.

PARAMETERS

None.

USAGE

byte seconds = Clock.getSeconds();

byte getMinutes (void)

Receives minutes from the application.

SYNTAX

Clock.getMinutes( );

RETURNS

Minutes in byte.

PARAMETERS

None.

USAGE

byte minutes = Clock.getMinutes();

byte getHours (void)

Receives hours from the application.

SYNTAX

Clock.getHours( );

RETURNS

Hours in byte.

PARAMETERS

None.

USAGE

byte hours = Clock.getHours();

byte getDay (void)

Receives day in numbers from the application.

SYNTAX

Clock.getDay( );

RETURNS

Days in byte.

PARAMETERS

None.

USAGE

byte day = Clock.getDay();

byte getMonth (void)

Receives month in numbers from the application.

SYNTAX

Clock.getMonth( );

RETURNS

Months in byte.

PARAMETERS

None.

USAGE

byte month = Clock.getMonth();

short getYear (void)

Receives year in numbers from the application.

SYNTAX

Clock.getYear( );

RETURNS

Years in short integers.

PARAMETERS

None.

USAGE

short int year = Clock.getYear();