2 Replies Latest reply on Dec 16, 2014 9:15 AM by loffenauer

    javascript mraa analog pin readings seem to be 9-bit ?



      I am using mraa via the JavaScript binding.



      var mraa = require('mraa');

      var analogPin0 = new mraa.Aio(0);

      var value = analogPin0.read();


      I have hooked A0 to 5V and the maximum integer value delivered is 511, which seems to deliver 9 bits at max (2^9-1 = 511).


      The documentation is very confusing. The hardware documentation says that the AD of the Edison is 12bit. Looking at mraa sourcecode the default bits in software are 10 bits, so I would expect 1023 as the maximum value when having a  5V input.


      I there something that I have overseen ?

      Is the resolution delivered to Javascript only 9 bits ?


      Thanks for the clarification