ADC: Re-scaled values

Posted on
  • Hello,
    just found this in the documentation (ADC.md):

    "This returns a value between 0 and 1 (internally ADCs in Espruino are usually 12 bits, but these are re-scaled)."

    What means "re-scaled"? Does Espruino use less than 12 bits?

  • Hi, No - perhaps that needs changing.

    Espruino uses all 12 bits - it just divides the value by 4096 (in this case) so the number you get is between 0 and 1.

    This means that if you use another board with a different ADC (maybe a 10 bit one) the values will still be between 0 and 1 and your code will still work.

  • Ah, I see. Thanks for clarifying this.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

ADC: Re-scaled values

Posted by Avatar for tickTock @tickTock

Actions