7 Replies Latest reply on Dec 4, 2015 4:05 PM by CMata_Intel

    Different mraa.aio read value between SDCard.1.0.4.tar.gz and iot-devkit-latest-mmcblkp0.direct

    joe-iot

      Hey all - I recently switched from the SD Card image <SDCard.1.0.4.tar> from <Download Intel® Arduino IDE 1.6.0 >, where I had to build and install MRAA to read sensor values with Python to the IoT-DevKit Latest image.

       

      When I read the pin value of a TMP36 what used to work fine is now off by 200°F. Any ideas why?

       

      Code:

      #!/usr/bin/env python
      import mraa
      import sys 
      import time
      
      tempPin = mraa.Aio(0) 
      print(mraa.getVersion())
      
      while 1: 
              tempMV = float(tempPin.read())
              print "Analog Read: " + str(tempMV)
              voltage = (tempMV * 5.0) / 1024.0
              print "Voltage: " + str(voltage)
              tempC= (voltage - 0.5 ) * 100
              tempF= (tempC * 9.0 / 5.0) + 32.0
              print "Temperature F: " + str(round(tempF))
              time.sleep(10)
      

      Output

      root@galileo:~# ./temp.py 
      v0.7.2
      Analog Read: 363.0
      Voltage: 1.7724609375
      Temperature F: 261.0
      

       

      Sys info

       

      root@galileo:~# uname -a

      Linux galileo 3.8.7-yocto-standard #1 Tue Jun 9 22:07:14 GMT 2015 i586 GNU/Linux

      root@galileo:~# cat /etc/version

      201506210418


      And the wiring (it's not an arduino Yun, but you get the idea).

      F38E9SDIH65SFEG.MEDIUM.jpg


      Thanks!

      -Joe