Question: hey making weighting machine project using PIC 18F4520 and i also used AD620 I wrote some code but my project ?s not working can you
hey making weighting machine project using PIC 18F4520 and i also used AD620 I wrote some code but my project ?s not working can you plases see if i have probelm wIth my codes
i will also upload the digram that I used for my circut

sbit lcd_RS at RD2_bit;
sbit lcd_EN at RD3_bit; sbit lcd_D4 at RD4_bit; sbit lcd_D5 at RD5_bit; sbit lcd_D6 at RD6_bit; sbit lcd_D7 at RD7_bit; sbit lcd_RS_direction at TRISD2_bit; sbit lcd_EN_direction at TRISD3_bit; sbit lcd_D4_direction at TRISD4_bit; sbit lcd_D5_direction at TRISD5_bit; sbit lcd_D6_direction at TRISD6_bit; sbit lcd_D7_direction at TRISD7_bit; int adc_rd; float adc_val; float wt; char finaltxt[8]; float quant=5.0/1024; void main() { //char res[5]; PORTD=0xFF; TRISD=0xFF; ADCON1=0Xc0; ADC_Init(); LCD_Init(); lcd_cmd(_LCD_CLEAR); lcd_cmd(_LCD_CURSOR_OFF); while(1) { adc_rd=ADC_Read(0); adc_val=adc_rd*quant; wt=(adc_val-0.361)/0.079; sprintf(finaltxt,"%1.2f",wt); lcd_cmd(_LCD_CLEAR); Lcd_Out(1,1,"WEIGHT: "); Lcd_Out(1,9,finaltxt); Lcd_Out(1,14,"KGs"); Delay_ms(1000); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
