first steps for time

This commit is contained in:
Hendrik Schutter 2018-11-21 23:45:26 +01:00
parent b555118efa
commit 2769d52fc9
2 changed files with 28 additions and 1 deletions

View File

@ -14,6 +14,29 @@ int main(void) {
io.setActiveLED(true);
io.activateChargers();
time_t testStamp;
time(&testStamp);
char charTime[255];
dtostrf(testStamp, 4, 2, charTime);
serialSend("Time: ");
serialSend (charTime);
serialSend(" \r\n");
_delay_ms(1000);
time(&testStamp);
dtostrf(testStamp, 4, 2, charTime);
serialSend("Time: ");
serialSend (charTime);
serialSend(" \r\n");
_delay_ms(1000);
/* create charger */
s_charger charger_settings;

View File

@ -1,15 +1,18 @@
/* system header */
#include <avr/io.h>
#include <string.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
/* project header */
#include "ioController.h"
#include "multiplexer.h"
#include "charger.h"
/* PINS */
/* Pins */
#define WS2812B PD2
#define ACTIVELED PB5
#define PROBE15V PC1
@ -23,6 +26,7 @@
#define S1 PD6
#define S0 PD5
/* Serial */
#define BUAD 9600
#define BUAD_RATE_CALC ((F_CPU/16/BUAD) - 1)