Question: Project Name: - _ ( A ) DC _ ( L ) ED _ ( B ) ar _ ( G ) raph Description: -

Project Name:-
_(A)DC_(L)ED_(B)ar_(G)raph
Description:- This program reads the Analog voltage from the potentiometer on input "AN0
(RA0)" and turns ON the 10 LEDs connected to ports RA 2:1> and RB7:0>RB7:0>()/()#define ONE_(L)ED ....
()/()#define TWO_(L)EDS ...
......
()/()#define TEN_(L)EDS
Setup PORTB pins RB7:0> as Digital Outputs.
Setup AN(0)/(R)A0 pin as an Analog input.
Setup pins RA2:1> as Digital Outputs.
Setup the ADC as follows (see ADCON0 & ADCON1 registers on pages(114)/(115) of the
PIC16F188 Datasheet):-
ADCON0
Setup "ADCS 1:0>" bits to select the internal RC
oscillator
Setup "CHS2:0>" to select Channel 0(i.e. RA(0)/(A)N0)
Setup "ADON" bit to turn on( A)/(D) module
ADCON1
Setup "ADFM" bit to select Right Justified result
Setup "ADCS2" bit as disabled
Setup "VCFG1:0>" bits to use AVDD and AVss
Create a 16-bit variable called "adc_(v)al", to store the 10-bit adc result.
Inside a continuous loop, start an (A)/(b)ar (D)C2:1>,RB7:0>
Project Name: - _ ( A ) DC _ ( L ) ED _ ( B ) ar

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Electrical Engineering Questions!