Question: I couldnt understand the code can someone explain it to my step by step Nrite the code as below to main.c. #include > #include Icd.h

I could"nt understand the code can someone explain it to my step by step

I could"nt understand the code can someone explain it to my stepby step Nrite the code as below to main.c. \#include > \#include"Icd.h" \#include // we need this library for C standard itoa function(integer to ascii function) _CONFIG(0x3ff9) unsigned int i,j=0 Microprocessors and lab. Application

Nrite the code as below to main.c. \#include > \#include "Icd.h" \#include // we need this library for C standard itoa function (integer to ascii function) _CONFIG(0x3ff9) unsigned int i,j=0 Microprocessors and lab. Application sheet Date: char buffer[6]; unsigned int x; void main(void) \{ Icd_init(); GIE=0; // we don't want interrupts while (1) \{ for (i=0;i htc.h //unsigned int conversiondatah, conversiondatal; // / Analog to Digital Converter initialization // void init_a2d(void) \{ // Right justified reading, Channel 0 Select, Fosc/2 select ADCONO=0;ADCON1=0x85; ADCONO=0; // select Fosc/2; ADCCON1 =0x5 olmal Microprocessors and lab. Application sheet Date: ADCON1=085;//A/D port configuration 0 ADCONO|=0x1; // turn on the A2D conversion module TRISA=0xOf; // make all input \} / Analog to Digital Conversion */ / This function returns 10 bit conversion result for selected channel % /**************************************************************/ unsigned int read_a2d(unsigned char channel) \{ unsigned int conversiondata; channel\&=0x07; // truncate channel to 3 bits ADCONO\&=0xC5; // clear current channel select ADCONO=( channel// apply the new channel select ADCONO =1

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 Databases Questions!