Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

#include<pic.

h>
#include"pic_lcd8.h"
#include"pic_serial.h"
#include"pic_adc.h"

#define u_char unsigned char


#define u_int unsigned int

u_char ecg_fun();
u_char pressure_fun();
u_char temp_fun();

void blue_tooth();

u_char msec,sec,Buffer[10],x,pluse_count,EMG,Pressure,heart_beat,heart_beat1,Temp;
void main()
{
GIE=1;
PEIE=1;

ADCON1=0X00;

TRISA=0x0F;
TRISB=0x01;
TRISC=0x84;

TRISD=0x00;
TRISE=0x03;

//TMR1IE=1;
//TMR1ON=1;

//TMR1H=0x3c;
//TMR1L=0xAF;

Lcd8_Init();

Lcd8_Display(0x80,"--ANDRIOD BASED-",16);
Lcd8_Display(0xc0,"-HEALTH CARE SYS",16);
Delay(65000);Delay(65000);Delay(65000);

Serial_Init(9600);

// INTF=1;
//INTEDG=0;

Delay(65000);
Receive(0);
Lcd8_Command(0x01);

while(1)
{

ecg_fun();

blue_tooth();
}

/*void interrupt timer1(void)


{
if(INTF==1)
{
INTF=0;

pluse_count++;
}

if(TMR1IF==1)
{
TMR1IF=0;
msec++;
if(msec>19)
{
sec++;
msec=0;

}
if(sec>59)
{

pluse_count=0;sec=0;
}
}

}*/

void blue_tooth()
{
Serial_Out('*');
Serial_Out((EMG/100)+0x30);
Serial_Out(((EMG%100)/10)+0x30);
Serial_Out(((EMG%100)%10)+0x30);

u_char ecg_fun()
{
Lcd8_Display(0x80,"ECG VAL:",8);
EMG=Adc8_Cha(0);
Lcd8_Decimal3(0x88,EMG);
}

You might also like