LUFA Library  210130
Temperature Sensor Driver - LUFA/Drivers/Board/Temperature.h

NTC Temperature Sensor board hardware driver.

Module Source Dependencies

The following files must be built with any user project that uses this module:

Module Description

Temperature sensor driver. This provides an easy to use interface for the hardware temperature sensor located on many boards. It provides an interface to configure the sensor and appropriate ADC channel, plus read out the current temperature in degrees C. It is designed for and will only work with the temperature sensor located on the official Atmel USB AVR boards, as each sensor has different characteristics.

Example Usage

The following snippet is an example of how this module may be used within a typical application.

// Initialize the ADC and board temperature sensor drivers before first use
Temperature_Init();
// Display converted temperature in degrees Celsius
printf("Current Temperature: %d Degrees\r\n", Temperature_GetTemperature());
#define ADC_FREE_RUNNING
Definition: ADC_AVR8.h:132
static void ADC_Init(const uint8_t Mode) ATTR_ALWAYS_INLINE
Definition: ADC_AVR8.h:414
#define ADC_PRESCALE_128
Definition: ADC_AVR8.h:161