#include <main.h>
#include <math.h>
#define LCD_ENABLE_PIN PIN_D0
#define LCD_RS_PIN PIN_D1
#define LCD_RW_PIN PIN_D2
#define LCD_DATA4 PIN_D4
#define LCD_DATA5 PIN_D5
#define LCD_DATA6 PIN_D6
#define LCD_DATA7 PIN_D7
#define A PIN_E0
#define B PIN_E1
int8 tasma=0;
float zaman=0,aci=0,gf=0;
#include <lcd.c>
void main()
{
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1|RTCC_8_bit); //51,2 us overflow
lcd_init();
while(TRUE)
{
if(input(A))
{set_timer0(0);
}
if(input(B))
{
tasma=get_timer0();
zaman=tasma*52,2*(10^-6);
aci=zaman*50*360;
gf=cos(aci);
printf(lcd_putc,"Guc Fak.=%f",gf);
tasma=0;
delay_ms(50);
}//TODO: User Code
}
}