تم اضافة صورة للوقود ولكن اريد ان اضيف صورة بجانبها قعدت وقت طويل وعلى الفاضي ومشاكل كثيرة حصلت
كيف اضيف رسمة اخرى بجانب الوقود
وايضا اضافة حركات بين E و F
تزداد وتنفص مع المقاومة المتغيرة
واذا قلت قيمة المقاومة المتغيرة عن 10 %
اضاء ليد احمر
او رسمه الوقود اصبحت تظهر وتختفي
كود:
sbit LCD_RS at RB2_bit;
sbit LCD_EN at RB3_bit;
sbit LCD_D7 at RB7_bit;
sbit LCD_D6 at RB6_bit;
sbit LCD_D5 at RB5_bit;
sbit LCD_D4 at RB4_bit;
sbit LCD_RS_Direction at TRISB2_bit;
sbit LCD_EN_Direction at TRISB3_bit;
sbit LCD_D7_Direction at TRISB7_bit;
sbit LCD_D6_Direction at TRISB6_bit;
sbit LCD_D5_Direction at TRISB5_bit;
sbit LCD_D4_Direction at TRISB4_bit;
const char character[] = {31,17,17,31,31,31,31,31};
void CustomChar(char pos_row, char pos_char) {
char i;
Lcd_Cmd(64);
for (i = 0; i<=7; i++) Lcd_Chr_CP(character[i]);
Lcd_Cmd(_LCD_RETURN_HOME);
Lcd_Chr(pos_row, pos_char, 0);
}
void main()
{float x=0;int y;
char txt[15];
lcd_init();
lcd_out(1,5,"FULE");
lcd_out(2,16,"F");
lcd_out(2,1,"E");
lcd_out(1,16,"%");
trisa.f0=1;
adcon1=0x80;
lcd_cmd(_lcd_cursor_off);
while(1)
{
x=adc_read(0);
x=x*10000/1023;
x=x/100 ;
floattostr(x,txt);
for(y=0;y<4;y++)
lcd_chr(1,y+11,txt[y]);
delay_ms(20);
CustomChar(1,3);
}
sbit LCD_RS at RB2_bit;
sbit LCD_EN at RB3_bit;
sbit LCD_D7 at RB7_bit;
sbit LCD_D6 at RB6_bit;
sbit LCD_D5 at RB5_bit;
sbit LCD_D4 at RB4_bit;
sbit LCD_RS_Direction at TRISB2_bit;
sbit LCD_EN_Direction at TRISB3_bit;
sbit LCD_D7_Direction at TRISB7_bit;
sbit LCD_D6_Direction at TRISB6_bit;
sbit LCD_D5_Direction at TRISB5_bit;
sbit LCD_D4_Direction at TRISB4_bit;
const char character[] = {31,17,17,31,31,31,31,31};
void CustomChar(char pos_row, char pos_char) {
char i;
Lcd_Cmd(64);
for (i = 0; i<=7; i++) Lcd_Chr_CP(character[i]);
Lcd_Cmd(_LCD_RETURN_HOME);
Lcd_Chr(pos_row, pos_char, 0);
}
void main()
{float x=0;int y;
char txt[15];
lcd_init();
lcd_out(1,5,"FULE");
lcd_out(2,16,"F");
lcd_out(2,1,"E");
lcd_out(1,16,"%");
trisa.f0=1;
adcon1=0x80;
lcd_cmd(_lcd_cursor_off);
while(1)
{
x=adc_read(0);
x=x*10000/1023;
x=x/100 ;
floattostr(x,txt);
for(y=0;y<4;y++)
lcd_chr(1,y+11,txt[y]);
delay_ms(20);
CustomChar(1,3);
}