Example Code for Mind+-Read DHT11 Temperature

The following example will use the Xingkong Board K10 for programming, with an external DHT11 temperature and humidity sensor connected to the expansion board to read the current ambient temperature.

Hardware Preparation

  • UNIHIKER K10 (Xingkong Board K10)
  • DFR1231 Expansion Board
  • DHT11 Temperature and Humidity Sensor

Software Preparation

Step 1: Download and install Mind+: https://mindplus.cc/

Wiring Diagram

As shown in the diagram, connect the DHT11 module to the C0 port of the expansion board.

  • Black wire: GND, connected to the black "G" pin.
  • Red wire: Positive power supply, connected to the red "3V3" pin.
  • Green wire (or blue wire): Signal wire, connected to the blue "C" pin.

Other Preparation Work

Step 1: Download and install Mind+: https://mindplus.cc/

Step 2: Click the "Extensions" button:

Step 3: Select UNIHIKER K10:

Step 4: Import the user library: Click "User-Ext", copy and paste the following URL in the search box and import the user-ext
https://github.com/YeezB/ext-K10IOExtender

Step 5: After successful loading, click the "Back" button to return to the main interface.

The following figure shows the user library that has been successfully loaded:

Sample Code

Result

As shown in the following diagram, the program reads the ambient temperature detected by the DHT11 connected to the C0 port and displays it on the screen of the Xingkong Board K10, with the temperature being 30.7℃.

Was this article helpful?

TOP