Skip to content

Commit 5b5d066

Browse files
committed
Adding CPU temp examples for template.
1 parent a0bffd6 commit 5b5d066

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"""CircuitPython CPU temperature example in Celsius"""
2+
import time
3+
import microcontroller
4+
5+
while True:
6+
print(microcontroller.cpu.temperature)
7+
time.sleep(0.15)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"""CircuitPython CPU temperature example in Fahrenheit"""
2+
import time
3+
import microcontroller
4+
5+
while True:
6+
print(microcontroller.cpu.temperature * (9 / 5) + 32)
7+
time.sleep(0.15)

0 commit comments

Comments
 (0)