Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: clock shield problem #319244
    avatarKeithL
    Participant

    Just noticed the code didn’t post earlier. Here it is:

    #define CUSTOM_SETTINGS
    #define INCLUDE_SMS_SHIELD
    #define INCLUDE_CLOCK_SHIELD
    #define INCLUDE_TERMINAL_SHIELD

    /* Include 1Sheeld library. */
    #include <OneSheeld.h>

    boolean toggle0 = 0;

    /* Define some variables for the date and time. */
    byte hour, minute, second;

    String SMS_message;

    void setup()
    {
    /* Start communication. */
    OneSheeld.begin();

    analogReference(EXTERNAL);

    pinMode(13, OUTPUT);

    }

    void loop()
    {

    /* get the time when our delay runs out */
    delay(10000);

    Clock.queryDateAndTime();

    hour = Clock.getHours();
    minute = Clock.getMinutes();
    second = Clock.getSeconds();

    SMS_message = “”;
    SMS_message += String(hour);
    SMS_message += ‘:’;

    if(minute < 10)
    SMS_message += ‘0’; // inert a leading zero in the time if we need to

    SMS_message += String(minute);

    SMS_message += ‘:’;

    if(second < 10)
    SMS_message += ‘0’; // inert a leading zero in the time if we need to

    SMS_message += String(second);

    SMS_message += ‘\n’;

    Terminal.print(SMS_message);
    }

    in reply to: clock shield problem #319240
    avatarKeithL
    Participant

    Some more details: After resetting the Uno R3, the terminal kept displaying messages all day with the time continuing to be 0:00:00, so, the terminal doesn’t seem to be the problem. I left it to run while I took my phone out of range for a couple hours (the blue light was flashing when I returned, of course), and when I re-connected, the yellow TxD light started flashing again, and once again, the correct time was being displayed on the terminal messages.

Viewing 2 posts - 1 through 2 (of 2 total)