This oled display uses the I2C protocol to communicate to the microcontroller. So here you need only 2 pins i.e. SDA and SCL from the microcontroller and the VCC and GND.
inorder to initialise the sensor, we hae to pull the data line LOW for around 500 us (microseconds) and pull it HIGH for around 20-40 us. After this DHT22 will pull the line low for 80us and than high for 80us.
HAL_Delay is able to provide minimum 1ms delay but when it comes to microsecond, there isn’t any predefined function to create 1us delay. In this tutorial, I am going to show you how to create 1 microsecond delay in STM32
In the ADC configuration, Enable SCAN CONVERSION and Continuous Conversion, If you don’t know what they are, please go to the links in the first paragraph.