1
0

Add hardware support for GPS, MAX7219, BME280, and MQ7 sensors

- Implemented GPS functionality with initialization and reading latitude and longitude.
- Added MAX7219 display support, including initialization, text display, animation control, and brightness settings.
- Integrated BME280 sensor for reading temperature, pressure, and humidity.
- Developed MQ7 sensor interface for reading gas concentration values.
- Created HTTP client for GET and POST requests.
- Implemented MQTT client for message handling and connection management.
- Added JSON serialization and deserialization functions for sensor and actuator data.
- Established WiFi connection setup for network communication.
This commit is contained in:
Jose
2025-04-25 22:29:57 +02:00
parent 0c09fcd913
commit 51db158354
18 changed files with 441 additions and 303 deletions

View File

@@ -0,0 +1,28 @@
#include "RestClient.hpp"
HTTPClient httpClient; // HTTP client object
void getRequest(const String url, String &response)
{
httpClient.begin(url);
int httpCode = httpClient.GET();
if (httpCode > 0) {
response = httpClient.getString();
} else {
response = "Error: " + String(httpCode);
}
httpClient.end();
}
void postRequest(const String url, String &payload, String &response)
{
httpClient.begin(url);
httpClient.addHeader("Content-Type", "application/json");
int httpCode = httpClient.POST(payload);
if (httpCode > 0) {
response = httpClient.getString();
} else {
response = "Error: " + String(httpCode);
}
httpClient.end();
}