Yours might be slightly different in some ways, but all multimeters are similar for the most part. In this guide, I’ll be referring to my own multimeter and using that as our example throughout this guide. RELATED: The Different Kinds of Electrical Outlets You Can Install In Your House If you’re just getting started, here’s how to use one and what all those confusing symbols mean. After that we display voltage value on LCD second line.īefore printing value on LCD, we first convert integer variable “voltage” into string by using inttostr() routine.If you’re doing any kind of electrical work-no matter what the application is-one of the best tools you can have at your disposal is a multimeter. Second line converts measured digital value back into analog voltage by multiplying voltage variable with resolution factor and voltage divider scale down factor. Inside this loop, ADC_Read(0) reads analog input signal value from AN0/RA0 pins and store this value into a variable “voltage”. This code is placed inside the while(1) loop function and it keeps executing. LCD_Out(1, 1, "Digital voltmeter") // print "Digital voltmeter"on first line and first rowĭelay_ms(1000) // add a delay of one second LCD_Cmd(_LCD_CLEAR) // Clear whatever is written on LCD LCD_Cmd(_LCD_CURSOR_OFF) // turn off LCD cursor These code lines initialize built-in library of ADC module and liquid crystal dislpay. These lines are used to define pic microcontroller pins that will be used with 16×2 LCD. First, we used ‘sbit’ to define pins connection with LCD and PIC16F877A. Now let’s understand the working of code. Inttostr(voltage,volt) // it converts integer value into string
0 Comments
Leave a Reply. |