Sayfalar

Menü

22 Kasım 2020 Pazar

Kumbara EEPROM örnek uygulama ccs compiler

Kumbara EEPROM örnek uygulama ccs compiler örnek uygulama dahili eeprom kullanıldı.

 #include<16f877a.h>

#device adc=8

#fuses nowdt,xt,nolvp

#use delay(clock=4m)

#define use_portb_lcd true

#include<lcd.c>

long tl5,tl10,tl20,tutar,okunan;

void main()

{

set_tris_a(0xff);

set_tris_d(0x00);

lcd_init();

while(true)

{

okunan=read_eeprom(16);

if(okunan==255)

{

write_eeprom(0,0);

write_eeprom(1,0);

write_eeprom(2,0);

write_eeprom(16,0);

}

lcd_gotoxy(2,1);

printf(lcd_putc,"Kumabra tutarI");


tl5=read_eeprom(0);

tl10=read_eeprom(1);

tl20=read_eeprom(2);

tutar=tl5*5 + tl10*10 + tl20*20;

lcd_gotoxy(6,2);

printf(lcd_putc,"%ld",tutar);

lcd_gotoxy(9,2);

printf(lcd_putc,"TL");

if(input(pin_a0)==1)

{

while(input(pin_a0)==1);

lcd_init();

tl5++;

write_eeprom(0,tl5);

}

if(input(pin_a1)==1)

{

while(input(pin_a1)==1);

lcd_init();

tl10++;

write_eeprom(1,tl10);

}

if(input(pin_a2)==1)

{

while(input(pin_a2)==1);

lcd_init();

tl20++;

write_eeprom(2,tl20);

}

}

}



Hiç yorum yok:

Yorum Gönder

Her yorum bilgidir. Araştırmaya devam...