> For the complete documentation index, see [llms.txt](https://mwx.twelite.info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mwx.twelite.info/latest_en/sensor_object/shtc3.md).

# SHTC3 - Temp/Humd sensor

This is a temperature/humidity sensor using I2C bus.

{% hint style="warning" %}
Available only when board BEHAVIOR `<PAL_AMB>` is loaded. Procedures of common methods except `begin()` are executed in board BEHAVIOR.
{% endhint %}

## Process flow

1. `Wire.begin()`: initialize bus 2.`.begin()`: Start sensor operation 3.
2. wait a few ms
3. `.available()` becomes `true 5.`.get\_temp(), .get\_humid()\`: read values

## Procedures required for operation

### Wire bus

Before calling `begin()` method, Wire is put into operation by `Wire.begin()`.

### Procedures when returning from sleep

Keep the Wire bus in operation just before sleep (the Wire is automatically restored after returning from sleep).

## Methods

### get\_temp(), get\_temp\_cent()

```cpp
double get_temp()
int16_t get_temp_cent()
```

Read temperature. `get_temp()` returns a value in °C and `get_temp_cent()` returns an integer value that is 100 times the value in °C.

On error, values between -32760 and -32768 are returned.

### get\_humid(), get\_humid\_per\_dmil()

```cpp
double get_humid()
int16_t get_humid_per_dmil()
```

Reads the humidity. `get_humid()` returns an integer value in % and `get_humid_per_dmil()` returns an integer value in % times 100.

On error, values between -32760 and -32768 are returned.

## Common methods

### setup()

```cpp
void setup() 
```

Allocates and initializes memory space for the sensor.

### begin(), end()

```cpp
void begin()
void end()
```

Starts acquiring a sensor. Wait about 5 ms before reading the sensor value.

Does not support `end()`.

### process\_ev()

```cpp
void process_ev(uint32_t arg1, uint32_t arg2 = 0)
```

In the case of a sensor with wait processing, `arg1` is given `E_EVENT_TICK_TIMER` or `E_EVENT_START_UP` to indicate the elapse of time. After calling this method, if the required time has elapsed, it will be available and the sensor value can be read.

### available()

```cpp
bool available()
```

Returns `true` when the sensor satisfies the readout condition.

### probe()

```cpp
bool probe()
```

Returns `true` when the sensor is connected.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://mwx.twelite.info/latest_en/sensor_object/shtc3.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
