We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 98eb1fb commit ff67a72Copy full SHA for ff67a72
Make_It_Hot_Cold/hot.py
@@ -0,0 +1,25 @@
1
+import time
2
+from adafruit_crickit import crickit
3
+
4
+print("Heating Pad Demo")
5
6
+# For signal control, we'll chat directly with seesaw
7
+ss = crickit.seesaw
8
+TMP36 = crickit.SIGNAL1 # TMP36 connected to signal port 1 & ground
9
+POT = crickit.SIGNAL8 # potentiometer connected to signal port 8 & ground
10
11
+heating_pad = crickit.dc_motor_2
12
13
+while True:
14
15
+ voltage = ss.analog_read(TMP36) * 3.3 / 1024.0
16
+ tempC = (voltage - 0.5) * 100.0
17
+ tempF = (tempC * 9.0 / 5.0) + 32.0
18
19
+ heat_value = ss.analog_read(POT) / 1023.0
20
21
+ print((tempF, heat_value))
22
23
+ heating_pad.throttle = heat_value # set heat value to Motor throttle value
24
25
+ time.sleep(0.25)
0 commit comments