Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- This is an example to use RTChardware library
- RTChardware is meant to use with tm4c129 wich suports calendar mode.
- There's a bug with the year and week day so those don't work
- This shows how to set up a interrupt every second
- Created 21/06/2014
- */
- #include <RTChardware.h>
- //Variables to store values
- long int Time[3];
- long int Date[4];
- boolean state = false;
- unsigned long count = 0;
- void test(){
- Serial.println("hey, i'm a second");
- state = !state;
- count++;
- }
- void setup()
- {
- Serial.begin(9600);
- RTC.begin(); //Initiaes clock
- pinMode(PN_1, OUTPUT);
- RTC.setInterrupt(test,0,0,1); //set interrupt to fuction "test" every 1 second. you can set any interval, until 23:59:59.
- }
- void loop()
- {
- digitalWrite(PN_1, state);
- Serial.println(count);
- delay(500);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement