In the previous post, we show how to use ADC library function in CCS PICC. Here, the ADC is still in the discussion. In this example, I use almost the same source code, but one's difference is the output LED displays a bar graph pattern indicating the level of input voltage reading from the AN0.
ADC result is still 8-bit. This 8-bit result is scaled into an 9 number values correspond to 8 output LEDs on PORTD.
LED bar graph running |
Source code from GitHub gist.
Click here to download this example in zip file.
Schematic Diagram |
Thanks for visiting my blog.
ReplyDelete