ccs examples 16f628a
ccs pic compiler used to
#fuses INTRC_IO
Added after 2 minutes:
PIC CLOCK
#include <16F628.h>
#fuses NOWDT,NOPROTECT,NOLVP,INTRC_IO,NOLVP,NOMCLR
#use delay(clock=4000000)
#define DAL_SCL PIN_B3
#define DAL_SDA PIN_A4
#include <ds1624.c>
#include <lcd5.c>
BYTE saat=0;
BYTE dak=0;
BYTE san=0;
BYTE value;
char say=0;
char a=0;
///////////////////////////////7777
void goster()
{
lcd_gotoxy(1,2);
printf(LCD_PUTC, "time %02u",saat);
lcd_gotoxy(8,2);
printf(LCD_PUTC, ":%02u",dak);
lcd_gotoxy(11,2);
printf(LCD_PUTC, ":%02u",san);
}
////////////////////////////////////////
void clock()
{
san++;
if(san==60)
{
san=0;
dak++;
}
if(dak==60)
{
dak=0;
saat++;
}
if(saat==24)
{
saat=0;
}
delay_ms(800);
}
////////////////////////7
void tempt()
{
init_temp();
value = read_temp();
lcd_gotoxy(1,1);
printf(lcd_putc,"\fSICAKLIK:%2u\r\n ",value);
delay_ms(5);
}
/////////////////////////
void ayar()
{
while(1)
{
if((!input(PIN_A7))&&(!input(PIN_A5)))
{
lcd_gotoxy(1,2);
// lcd_send_nibble(0xd);
saat=saat+1;
if(saat==24) saat=0;
}
if((!input(PIN_A6))&&(!input(PIN_A5)))
{
dak=dak+1;
if(dak==60) dak=0;
}
goster();
clock();
tempt();
}
}
//////////////////////////////////////
/////////////////////////////////////////
/////////////////////////////////////
//////////////////////////////////////
void main() {
init_temp();
lcd_init();
setup_comparator(NC_NC_NC_NC);
////////////////////////////////////////////////
lcd_putc("\f MYO PROJESi \n");
delay_ms(4000);
do
{
tempt();
goster();
clock();
for(a=0;a<5;a++)
{
if(!input(PIN_A5))
{
ayar();
}
}
}while(1);
}