User Manual

95
For Python users:
Step 2: Change directory
cd /home/pi/SunFounder_SensorKit_for_RPi2/Python/
Step 3: Run
sudo python 18_thermistor.py
Now touch the thermistor and you can see the value of current temperature printed on the
screen change accordingly.
Temperature alarm setting:
If you use the Analog Temperature Sensor module, uncomment the line under 1:
For C language:
55 // For a threshold, uncomment one of the code for
56 // which module you use. DONOT UNCOMMENT BOTH!
57 //-----------------------------------------
58 // 1. For Analog Temperature module(with DO)
59 tmp = digitalRead(DO);
60
61 // 2. For Thermister module(with sig pin)
62 // if (temp > 33) tmp = 0;
63 // else if (temp < 31) tmp = 1;
For Python
41 #################################################
42 # 1. For Analog Temperature module(with DO)
43 tmp = GPIO.input(DO);
44
45 # 2. For Thermister module(with sig pin)
46 #if temp > 33:
47 # tmp = 0;
48 #elif temp < 31:
49 # tmp = 1;
50 #################################################
If you use the Thermistor module, uncomment the lIne under 2:
For C language:
55 // For a threshold, uncomment one of the code for
56 // which module you use. DONOT UNCOMMENT BOTH!
57 //-------------------------------------------
58 // 1. For Analog Temperature module(with DO)
59 // tmp = digitalRead(DO);