Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions 06.ESP_TEMPERATURE/esp_temp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This program will run only on ESP32 boards. This program reads the internal temperature sensor readings on the ESP32.

import esp32
import time
for i in range(50):
F = esp32.raw_temperature()
print("Temperature in Fahrenheit =",F)
C = (F-32) * (5/9)
print("Temperature in Celsius =",C)
time.sleep(0.5)
15 changes: 15 additions & 0 deletions 06.ESP_TEMPERATURE/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 06_ESP_TEMPERATURE
To run the program use the following ampy command

##NOTE
The temperature values differ from chip to chip, and the temperature sensor returns a higher value than the room temperature because of the temperature that SoC is operating upon is higher and closer to the sensor. Typically the values are 20 Celsius higher than room temperature.

## MAC OS
```bash
ampy --port /dev/tty.SLAB_USBtoUART run accesspoint.py
```

## Linux
```bash
ampy --port /dev/ttyUSB0 run accesspoint.py
```