أخي اكتشفت المشكل وهو في الميكرو سي حيث أنه يرسل درجة الحرارة والدفولت في نفس السطر على ال-vitual terminal هكذا
لكن لم استطع إصلاحه

في حين عندما شاهدت الفيديو يرسل درجة الحرارة في سطر والدفولت في السطر الذي يليه
فأرجو منك التثبت من ملف الميكرو سي الصحيح
وباراك الله فيك
|
اه
اعتذر منك اخى نادر
انا لم ارسل لك ملفات السى +البروتس بعد التعديل الاخير لموافقة الفيجوال هذا كود السى الاخير
كود:
// fonction pour pour minimiser l'utilisation de la RAM
unsigned char st1[]=" Normal ",st2[]=" temp1 ",st3[]=" arret ",st4[]=" niv huile1 ";
unsigned char st5[]=" niv huile2 " ;
char a,b;
void LCD_constOut(unsigned char row, unsigned char col, const char *str)
{
while(*str)
{
LCD_chr(row, col++, *str++) ;
}
}
int t1,temp;
char *text[6];
void Text_To_Usart(unsigned char *m)
{
unsigned char j;
j = 0;
while(m[j] != 0)
{ // Send TEXT to USART
Usart_Write(m[j]);
j++;
}
}
// ******** Voila notre programme **********
void main()
{
TRISD=0B11111111;
TRISB=0B00000000;
loop:
Usart_init(9600); // Initialize USART module at 9600 bps
delay_ms(100); // Wait for USART module to stabilize
lcd_cmd(LCD_CURSOR_OFF);
lcd_cmd (lcd_clear) ;
adcon1=14;
lcd_init(&portb);
lcd_constOut(1,1,"Temp: ");
lcd_Out(1,12,"'C");
while(1)
{
delay_ms(1000);
t1=adc_read(0);
temp=0.245*t1*2;
inttostr(temp,text);
lcd_cmd(lcd_cursor_off);
lcd_out(1,6,text);
a=temp/10;
b=temp%10;
Usart_Write(a+48);//je veut l'afficher sur textbox1 de l'interface sous forme numerique comme sur LCD
Usart_Write(b+48);
Usart_Write(0x0D);
Usart_Write(0x0A);
if ((portd==0B00000000)&&(temp<60))// aucun boutton n'est activé donc aucun defaut
{
lcd_constOut(2,1,"Etat Normal :)");
// je veut l'afficher sur textbox2 de l'interface
Text_To_Usart(st1);
Usart_Write(0x0D);
Usart_Write(0x0A);
}
else if ((temp>=60)&&(temp<80)) // defaut temperature 1
{
lcd_constOut(2,1,"temp seuil 1 !!");
Text_To_Usart(st2);
Usart_Write(0x0D);
Usart_Write(0x0A);
// je veut l'afficher sur textbox2
}
else if (temp>80) // defaut temperature 2
{
lcd_constOut(2,1,"ARRET D'URGENCE!");
; // je veut l'afficher sur textbox2
Text_To_Usart(st3);
Usart_Write(0x0D);
Usart_Write(0x0A);
}
else if (portd==0B00000001) // entré de simulation boutton 1 activé
{
lcd_constOut(2,1,"Niveau huile 1!!");
Text_To_Usart(st4);
Usart_Write(0x0D);
Usart_Write(0x0A);
}
else if (portd==0B00000010) // entré de simulation boutton 2 activé
{
lcd_constOut(2,1,"Niveau huile 2!!");
Text_To_Usart(st5);
Usart_Write(0x0D);
Usart_Write(0x0A);
}
delay_ms(1000);
}
goto loop;
}
// MERCI pour votre attention et pour votre aide.
تحياتى
بالتوفيق