weber
Newbie level 3
rtc_get_time
i write this code in ccs-c but it didnt work
the question is how can i appoint values like x,y,z from rtc_get_time(hr,min,sec) function.i sumulated this program with proteus,i can set date and time ,it works very well,but i didnt get values from ds1302
i write this code in ccs-c but it didnt work
Code:
#include <16f84a.h>
#fuses Hs,NOWDT,NOPROTECT
#use delay(clock=4000000)
#byte PORTA = 5
#byte PORTB = 6
#include <DS1302a.c>
main(void)
{
char x,y,z;
rtc_init();
rtc_set_datetime(8,9,9,5,0,0);
portb=0;
SET_TRIS_B(0);
for(;;);
{
rtc_get_time(x, y, z);
if(y = 00) output_high(PIN_B0);
else
output_low(PIN_B0);
}
}