Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
Loading...
Searching...
No Matches
hdw-temperature.h File Reference

Detailed Description

Design Philosophy

Temperature sensor code code is based on Temperature Sensor Example.

Usage

You don't need to call initTemperatureSensor(). The system does at the appropriate time. If you're not using the sensor, you can call deinitTemperatureSensor() to disable it.

Call readTemperatureSensor() to get the chip's temperature in celsius.

Example

printf("%f\n", readTemperatureSensor());
float readTemperatureSensor(void)
Get a temperature reading from the ESP's onboard temperature sensor, in Celsius.
Definition hdw-temperature.c:45

Go to the source code of this file.

Functions

void initTemperatureSensor (void)
 Initialize the ESP's onboard temperature sensor.
 
void deinitTemperatureSensor (void)
 deinitialize the ESP's onboard temperature sensor
 
float readTemperatureSensor (void)
 Get a temperature reading from the ESP's onboard temperature sensor, in Celsius.
 

Function Documentation

◆ initTemperatureSensor()

void initTemperatureSensor ( void )

Initialize the ESP's onboard temperature sensor.

◆ deinitTemperatureSensor()

void deinitTemperatureSensor ( void )

deinitialize the ESP's onboard temperature sensor

◆ readTemperatureSensor()

float readTemperatureSensor ( void )

Get a temperature reading from the ESP's onboard temperature sensor, in Celsius.

Returns
A floating point temperature, or -274 if not read