I am developing firmware for the DHT11 sensor and ESP8266 (AT commands) with ATmega 2560 in embedded C. Below is the full code in Embedded C for both the devices.
For ESP