You are on page 1of 1

#include <16f877a.

h> #device adc=8 #fuses XT,NOWDT,PUT,NOBROWNOUT,NOLVP,NOCPD,NOWRT,NOPROTECT #USE DELAY (CLOCK=4000000) #use i2c(SLAVE, SDA=PIN_C4, SCL=PIN_C3, address=0xa0,FORCE_HW) #use standard_io (a) #use standard_io (c) void main(){ int a=0; int b=0; setUP_adc(ADC_CLOCK_INTERNAL); setup_adc_ports(AN0_AN1_AN3); while (true){ set_adc_channel(0); //lea el puerto 0 a=read_adc(); // valor es tomado del voltaje del puerto set_adc_channel(1); //lea el puerto 1 b=read_adc();// valor es tomado del voltaje del puerto }}

You might also like