AD conversion

This library is really minimal : I wrote it for my own needs, so source code must be edited to adapt it to yours.

  1. void AD_init()

    Initialize AD conversion system for 16MHz processor. AN0,AN1,AN2 and AN4 are used as analog inputs. AN3 is used as voltage reference input.

  2. unsigned long AD_get(unsigned int ch)

    Starts AD acquisition and conversion on channel ch. Channel number can be 0 (AN0), 1 (AN1), 2 (AN2) or 3 (AN4).



AG 2013-04-10