Skip to content

Instantly share code, notes, and snippets.

@kinasmith
Created March 22, 2018 03:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kinasmith/d22e29a9cb19dfef50024bc44922ea1c to your computer and use it in GitHub Desktop.
Save kinasmith/d22e29a9cb19dfef50024bc44922ea1c to your computer and use it in GitHub Desktop.
time usage of time library
#include "Time.h"
// read this: https://github.com/PaulStoffregen/Time/blob/master/examples/TimeSerial/TimeSerial.ino
// read this: https://codebender.cc/library/Time#Time.h
// ask me about what doesn't make sense.
//void setTime(int hr,int min,int sec,int day, int month, int yr);
void setup() {
Serial.begin(9600);
setTime(21,29,00,21,03,2018); //hour, minute, second, day, month, year
}
void loop() {
Serial.println(hour());
Serial.println(":");
Serial.println(minute());
Serial.println(":");
Serial.println(second());
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment