On 2-03-13 09:58, Sebastien Lelong wrote:
I'm writing a library for Maxbotix EZ1 sonar. Distance can be read through ADC, and converted as: 9.8mV <-> 1 inch @5V, 6.4mV <-> 1 inch @ 3V3. So I need to convert an ADC value to mV. Depending on the resolution, the upper value can vary: 256, 1024, 4096. I was wondering if there's a constant define somewhere in device files that would tell which ADC resolution is used. I can't even check ADC_RESOLUTION_HIGH since it's been removed (and would even not tell me all the details).
Currently there is no such constant and I don't see a possibility to derive such a constant from the MPLAB .dev files. So we would have to add it 'manually' (for example via the file devicespecific.json).
Isn't it possible to connect the ADC input pin temporary to Vref, or connect a free ADC pin to Vref? This would provide you the maximum ADC reading.
Regards, Rob. -- R. Hamerling, Netherlands --- http://www.robh.nl -- You received this message because you are subscribed to the Google Groups "jallib" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/jallib?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
