EJEMPLO 3: CONVERSION ANALOGICA DIGITAL Y ENCENDIDO DE LEDS
En este ejemplo se hará una conversión analógica digital al valor de un potenciómetro, y este valor de voltaje se visualizará a través de 5 leds, por lo cual, cada led indicara 1 Voltio, es decir si hay 3 leds encendidos indicara que hay más de 3 voltios y menos que 4. Recordemos que el conversor analógico digital del microcontrolador es de 10 bits lo cual nos da una resolución de 4.88mv. DIGITAL ANALOGUE CONVERSION AND LED ON In this example, a digital analog conversion will be made to the value of a potential, and this voltage value will be visualized through 5 LEDs, therefore, each LED will indicate 1 Volt, that is, if there are 3 LEDs on it indicates that there is more than 3 volts and less than 4. Recall that the digital analog converter of the microcontroller is 10 bits which gives us a resolution of 4.88mv. /* ------------------------------------------------------ Conversión analógica digital y encendido de leds -----------------...