Home » DEVELOPERS » Tutorials » The temperature

 Developers>Tutoriels>The temperature

In this tutorial you will learn to read the temperature sensor of MRPi1 robot.

The temperature sensor

The temperature sensor is soldered on the control board.

  • Type : Thermistor resistance
  • Negative temperature coefficient (NTC)

Read the temperature

  • Start the python program :
$ python

img1_led

  • import the mrpi1_lib library :
$ from mrpi1_lib import *
  • read the temperature :
>>> temperature()

img1

 The degree temperature should display in the python console.

Using a variable

 

>>> degree = temperature()
>>> print "The temperature is %f degree." %degree

img1-en