# Temperature Sensor Example

## Overview

This sample demonstrates the HAL flow for the K230 on-chip temperature sensor.

Source file:

```bash
src/rtsmart/examples/peripheral/tsensor/test_tsensor.c
```

## Sample Capabilities

- set single-shot or continuous mode
- set and read the trim value in the range `0..15`
- periodically read the current temperature in degrees Celsius
- exit with `Ctrl+C`

## Key APIs

- `drv_tsensor_set_mode()` / `drv_tsensor_get_mode()`
- `drv_tsensor_set_trim()` / `drv_tsensor_get_trim()`
- `drv_tsensor_read_temperature()`

## Build and Run

### Build

```bash
cd src/rtsmart/examples/peripheral/tsensor
make
```

### Run

```bash
./test_tsensor
```

## Output Description

The sample prints the current mode, trim setting, and temperature readings so you can verify the tsensor path.

## Differences from Older Descriptions

This page follows the current HAL sample implementation and parameter behavior in the SDK source.
