Project 11: R1BBIT ONE Transfers Data from DHT20 to R1BBIT NANO

Script for initializing the DHT20 sensor and sending variable values ​​to the 2nd device.

VAR T,F,H
DHT_INIT(T,H,1000)
WHILE(1)
F=T*9/5+32
VARIABLE_SET("57656","F=",F)
VARIABLE_SET("57656","H=",H)
WEND

Script for displaying received data from 1 device.

DISPLAY_INIT(SPI,ST7796,480,320,00,1,3,2) // Initialize display with SPI interface and ST7796 driver (480x320 resolution)
PAUSE 100 // Wait 100 ms for the display to stabilize
DISPLAY_CLEAR(0x0) // Clear the display with color 0x0001 
WHILE(1)
DISPLAY_TEXT(10,180,"TEMP: ",F.1,"F ",Font_11x18,3,0xFFFF)
DISPLAY_TEXT(10,100,"HUM: ",H.1,"% ",Font_11x18,3,0x00FF)
WEND

×
100%