Rancang Bangun Penjaga Jarak 10 Meter Antara Ibu Dan Anak Memanfaatkan Bluetooth HC-06 Berbasis Mikrokontroller ATMega 328

LAMPIRAN

1. Program
#include
#include
#include
// Alphanumeric LCD functions
#include
#define BUZ PORTD.4
#define LED PORTD.5
// Declare your global variables here
unsigned char sdt, cnt, sts;
unsigned int idx;
unsigned char buf[33];
eeprom unsigned char sens;
// External Interrupt 0 service routine
interrupt [EXT_INT0] void ext_int0_isr(void)
{
// Place your code here
sens++;
if (sens > 50) sens = 50;

lcd_gotoxy(14,0);
sprintf(buf,"%02",sens);
lcd_puts(buf);
delay_ms(250);
}
// External Interrupt 1 service routine
interrupt [EXT_INT1] void ext_int1_isr(void)
{
// Place your code here
sens--;
if (sens < 5) sens = 5;
lcd_gotoxy(14,0);
sprintf(buf,"%02",sens);
lcd_puts(buf);
delay_ms(250);
}
#define
#define
#define
#define

#define

DATA_REGISTER_EMPTY (1