alaalwi11
Member level 1
- Joined
- Nov 30, 2010
- Messages
- 32
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,288
- Location
- Al khurtum-Sudan
- Activity points
- 1,626
hi friends,
i tried this code for voltmeter but seem there are some errors because there is no text appear in lcd yet ididn't catch it can any one hellp me
i tried this code for voltmeter but seem there are some errors because there is no text appear in lcd yet ididn't catch it can any one hellp me
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 //LCD: configuración de pines 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; //LCD: direccionamiento de pines 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; unsigned long adc_value; unsigned char d1,d2,d3,d4; #define printV lcd_chr(2,11,48+d1); lcd_chr_cp(d2+48); \ lcd_chr_cp('.'); lcd_chr_cp(48+d3); \ lcd_chr_cp(48+d4); lcd_chr_cp('V'); #define calcV d1=adc_value/1000; d2=(adc_value%1000)/100; \ d3=((adc_Value%1000)%100)/10; d4=((adc_value%1000)%100)%10; void main() { ADCON1=0b10000010; TRISA=0XFF; Lcd_Init(); lcd_cmd(_LCD_CLEAR); lcd_cmd(_LCD_CURSOR_OFF); Lcd_Out(1,2,"EVA PROYECT's"); lcd_out(2,1,"voltage:"); for(;;){ adc_value=ADC_Read(0); adc_value=adc_value*5000/1023; calcV printV delay_ms(20); } }