Adding CPU temp examples for template.
This commit is contained in:
parent
a0bffd63d1
commit
5b5d066f3e
2 changed files with 14 additions and 0 deletions
7
CircuitPython_Templates/cpu_temperature.py
Normal file
7
CircuitPython_Templates/cpu_temperature.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
"""CircuitPython CPU temperature example in Celsius"""
|
||||
import time
|
||||
import microcontroller
|
||||
|
||||
while True:
|
||||
print(microcontroller.cpu.temperature)
|
||||
time.sleep(0.15)
|
||||
7
CircuitPython_Templates/cpu_temperature_f.py
Normal file
7
CircuitPython_Templates/cpu_temperature_f.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
"""CircuitPython CPU temperature example in Fahrenheit"""
|
||||
import time
|
||||
import microcontroller
|
||||
|
||||
while True:
|
||||
print(microcontroller.cpu.temperature * (9 / 5) + 32)
|
||||
time.sleep(0.15)
|
||||
Loading…
Reference in a new issue