peter002
Member level 3
- Joined
- Mar 18, 2013
- Messages
- 56
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Location
- Hindusthaan
- Activity points
- 1,765
helo everyone. i m trying to use the ad feature of the pic to show the conversion result on the lcd, i using microc pro for programming and the software shows 3 commans in ad header file that are adc_init, adc_read and adc_sample_read
but using these commands i m getting nothing on the lcd
below is the code i tried
lcd working ok, and i know i hav a lot of mistakes in that code, indeed i m an assembler, and in assembly i hav done that successfuly, but i wanna try in c now, plz hlp..
thanc in advance
but using these commands i m getting nothing on the lcd
below is the code i tried
sbit lcd_rs at rc0_bit;
sbit lcd_en at rc1_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_d3 at rb3_bit;
sbit lcd_d2 at rb2_bit;
sbit lcd_d1 at rb1_bit;
sbit lcd_d0 at rb0_bit;
sbit lcd_rs_direction at trisc0_bit;
sbit lcd_en_direction at trisc1_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;
sbit lcd_d3_direction at trisb3_bit;
sbit lcd_d2_direction at trisb2_bit;
sbit lcd_d1_direction at trisb1_bit;
sbit lcd_d0_direction at trisb0_bit;
char txt1[]="Mohit";
char txt2[]="Akash anand";
char i;
int x;
void main()
{
lcd_init();
lcd_cmd(_lcd_clear);
lcd_cmd(_lcd_cursor_off);
trisa=0xff;
adc_init();
delay_ms(50);
adcon1=0x00;
adcon0=0b10000000;
go_bit=1;
while(go_bit==1)
{
}
x= adc_get_sample(0);
lcd_out(1,3,"x=");
}
}
lcd working ok, and i know i hav a lot of mistakes in that code, indeed i m an assembler, and in assembly i hav done that successfuly, but i wanna try in c now, plz hlp..
thanc in advance