This program builds upon the previous example and includes even more features:
It includes the Servo library, which allows the program to control a servo motor.
It includes the Adafruit_SSD1306 library, which allows the program to display text on an OLED screen.
It defines several additional constants, including the servo pin and OLED reset pin.
In the setup function, it initializes the OLED screen, servo motor, and Bluetooth communication.
In the loop function, it reads the temperature and humidity values from the DHT sensor and displays them on the OLED screen.
It reads the value from a potentiometer connected to analog pin 0 and maps the value to a servo position, which it then sets using the myservo.write() function.
It reads the state of a button connected to the Arduino and turns on or off the LED depending on the button state. It also sends a message over Bluetooth to indicate the LED state.
The program includes a 2-second delay between each loop iteration.
Overall, this program demonstrates how to incorporate multiple sensors, displays, and communication modules into an Arduino project, while still maintaining good coding practices such as modular code organization, meaningful variable names, and comments
@J-M-L , @UKHeliBob and @paulpaulson
Sire, I would like to classify that it was a mistake that had been taken from another text. It does not relate to the post, so I deleted it.
Why did you decide to ask the forum rather than make YOUR assignment yourself? What will be point of your learning if all your assignments will be done by somebody, but not you?