diff --git a/06.ESP_TEMPERATURE/esp_temp.py b/06.ESP_TEMPERATURE/esp_temp.py new file mode 100644 index 0000000..8f6b9c1 --- /dev/null +++ b/06.ESP_TEMPERATURE/esp_temp.py @@ -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) diff --git a/06.ESP_TEMPERATURE/readme.md b/06.ESP_TEMPERATURE/readme.md new file mode 100644 index 0000000..3a33e60 --- /dev/null +++ b/06.ESP_TEMPERATURE/readme.md @@ -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 +```