I need help with this ASAP. I promise to give a thumbs up.
In this lab, you will get familiar with I2C communication for the Arduino ESP32 development board and make use of the WIFI capabilities to display the results in a browser. All 3 development boards incorporate the ESP32 in some form.
Lab Objectives:
1. Configure the slave address for the TMP100 sensor.
2. Set up the required circuitry using the recommended pull-up resistors and capacitors for the sensor (Page 19 of the sensor datasheet should be helpful).
3. Read temperature data from the sensor (in bytes).
4. Calculate and display the temperature in degrees Celsius and degrees Fahrenheit on a local machine using the Serial monitor for the Arduino.
5. Display the temperature on a remote device using the WIFI capabilities of the ESP32 device. At the minimum, you should be able to connect using telnet or HTTP from a laptop. Extra credit for being able to acquire the data and display it on your phone, that is, write a phone App to communicate with the device.
In order to understand how WIFI works on the ESP32, you will first write code to talk to a WEB server, namely Google, and display the result of searching your name. You do not need to format the resulting HTML but display the raw data into the serial monitor of the Arduino IDE.
The first part of the lab ensures that you are correctly connected to the Internet and that you can implement a client connection. You will program this part on the R4 and learn how to program the ESP32 present on the R4 board.
You might want to write the following function which will initialize your WIFI connection:
extern int wifi_startup(char ssid, char pass, bool verbose, IPAddress ip_address, int tries=5)
where ssid is the SSID (Service Set Identifier) of the wireless network, char pass is the required password for the wireless network, verbose is a Boolean which if true will output messages about the status of the connection as it is attempted, ip is the returned IP address from the DHCP WIFI server, and tries is the number of attempts to contact the WIFI server before giving up. The function will return an integer status code which is specific to the Arduino WIFI code: {WL_IDLE_STATUS, WL_NO_SSID_AVAIL, WL_SCAN_COMPLETED, WL_CONNECTED, WL_CONNECT_FAILED, WL_CONNECTION_LOST, WL_DISCONNECTED}. When in verbose mode, the ESP32 should report the meaning of each code to the Serial monitor. Otherwise, it should only report the code itself. The code should continue to make attempts until it either exhausts its tries or it successfully receives the WL_CONNECTED code.