السلام عليكم
لقد قمت بكتابةكود برنامج للاخ فهد عبدالعزيز لقياس درجة الحرارة حيث نقلت الكود من صور له وعندما قمت بتحويلة الى ملف HEX ظهر لي اخطا في الكود
الرابط
http://www.qariya.com/vb/showthread.php?t=86167&page=2
او اذا كان عند احد من الاخوة الكود ان ينزله في المنتدى
مع الاحترام
الكود
// LCD module connections
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D4 at RB0_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D7 at Rb3 _bit;
sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB5_bit;
sbit LCD_D4_Direction at TRISB0_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D7_Direction at TRISB3_bit;
// End LCD module connections
unsigned char ch; //
unsigned int adc_rd; // Declare variables
char *text; //
long tlong;
vid main() {
ANSEL = 0x04; // Pin RA2 is configured as an analog input
ANSELH = 0; // Rest of pins are configured as digital
TRISA = 0x04;
Lcd_lnit(); // LCD display initialization
Lcd_Cmd(_LCD_CURSOR_OFF); // LCD command (cursor LCD)
Lcd_Cmd(LCD_CLEAR); // LCD command (clear LCD)
text = "BOILER TEMP. "; // Define the first message
Lcd_Out(1,1,text); // Write the first message in the first
line
text = "LCD example"; // Define the second message
Lcd_out(2,1, text); // Define the first message
Delay_ms;
text "TEMPER.:"; // Define the third message
while (1) {
adc_rd = ADC_Read(2); // A/D conversation. Pin Pa2 is an
input
LCD_Chr(2,1,text) // Write result in the second line
tlong = (long)adc_rd * 150; // Convert the result in 150 C
tlong = tlong / 307; // 0..307 -> 0-150 C
ch = tlong / 10; // Extract hundreds of TEMP
// from result
Lcd_Chr(2,9,48+ch); // Write result in ASCll format
ch = (tlong / 10) % 10; // Extract tens of TEMP
Lcd_Chr_CP(48+ch); // Write result in ASCll format
Lcd_Chr_CP('C');
Delay_ms(1);
}
}