السلام عليكم ورحمة الله وبركاته ،،،
هذا كود على لغة السي لقراءة درجة الحرارة من السنسور عبر الميكرونترولر وإخراجها على شاشة lcd
وهذا رسم الدائرة

وهذا الكود على لغة السي
// Lcd pinout settings
sbit LCD_RS at Rc2_bit;
sbit LCD_EN at Rc1_bit;
sbit LCD_D7 at Rc7_bit;
sbit LCD_D6 at Rc6_bit;
sbit LCD_D5 at Rc5_bit;
sbit LCD_D4 at Rc4_bit;
// Pin direction
sbit LCD_RS_Direction at TRISc2_bit;
sbit LCD_EN_Direction at TRISc1_bit;
sbit LCD_D7_Direction at TRISc7_bit;
sbit LCD_D6_Direction at TRISc6_bit;
sbit LCD_D5_Direction at TRISc5_bit;
sbit LCD_D4_Direction at TRISc4_bit;
void main()
{
long mv;
char x;
char txt[12];
trisa.f0=1;
lcd_init();
lcd_cmd(_lcd_cursor_off);
while(1)
{
lcd_out(1,1,"TEMP=");
mv=ADC_Read(0);
mv=(mv*5000)>>10;
longtostr(mv/10,txt);
for(x=0;x<11;x++)
{
if(txt[x]!=' ')lcd_chr_cp(txt[x]);
}
}
}