Skip to content

Commit 5d52708

Browse files
authored
Merge pull request #1520 from kattni/template-cpu-temp
Adding CPU temp examples for template.
2 parents c743a19 + 5b5d066 commit 5d52708

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)