Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Temperature/Humidity sensor example

  • Target: IAR RISC-V GD32V Evaluation Board

This project exercises the SHT31 I2C Temperature/Humidity sensor.

Jumper settings

To run this example, make sure that the jumpers on the evaluation board are set to use the RGB LED. The settings are highlighted in the following tables:

J5 Position Option
1-2 LED3
2-3 Green LED
J6 Position Option
1-2 USB/Debug
2-3 J4
J8 Position Option
1-2 SW4
2-3 Red LED
J9 Position Option
1-2 SW5
3-4 Blue LED
5-6 LED4

Notes

Depending on the room temperature and humidity, you may need to adjust the fixed-point threshold values in main.c to ensure proper crossing over all threshold levels. These values are scaled by a factor of 1000 (e.g., 25'C is represented as 25000).

If adjustments are required for the current room conditions:

  • Update the temperature and humidity thresholds in main.c.
  • Rebuild the project.
  • Restart the debugging session.

The tables below show how threshold levels determine which LED is lit.

Temperature threshold Set when data is Board LED
Low below TEMP_LOW_THRESHOLD Blue LED
Medium between TEMP_LOW_THRESHOLD and TEMP_MEDIUM_THRESHOLD Green LED
High above TEMP_MEDIUM_THRESHOLD Red LED
Humidity threshold Set when data is Board LED
Low below HUM_LOW_THRESHOLD 3
Medium between HUM_LOW_THRESHOLD and HUM_MEDIUM_THRESHOLD 3 and 2
High above HUM_MEDIUM_THRESHOLD 3, 2 and 1