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:
@@ -1,7 +1,8 @@
|
||||
#include <Wire.h>
|
||||
#include <BME280I2C.h>
|
||||
|
||||
#define I2C_BMP280_ADDRESS 0x76
|
||||
#define I2C_BME280_ADDRESS 0x76
|
||||
|
||||
void BME280_Init();
|
||||
bool BME280_DataReady();
|
||||
bool BME280_Read(float &pressure, float &temperature, float &humidity);
|
||||
7
hardware/include/GPS.hpp
Normal file
7
hardware/include/GPS.hpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#include "TinyGPSPlus.h"
|
||||
|
||||
#define RX 4
|
||||
#define TX 5
|
||||
|
||||
void GPS_Init();
|
||||
void GPS_Read(float &lat, float &lon);
|
||||
17
hardware/include/MAX7219.hpp
Normal file
17
hardware/include/MAX7219.hpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <MD_Parola.h>
|
||||
#include <MD_MAX72XX.h>
|
||||
#include <SPI.h>
|
||||
|
||||
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
|
||||
#define MAX_DEVICES 4 // 4 modulos 8x8
|
||||
|
||||
#define DATA_PIN 19
|
||||
#define CS_PIN 18
|
||||
#define CLK_PIN 17
|
||||
|
||||
void MAX7219_Init();
|
||||
void MAX7219_DisplayText(const char *text, textPosition_t align, int speed, int pause);
|
||||
void MAX7219_StartAnimation();
|
||||
void MAX7219_StopAnimation();
|
||||
void MAX7219_ClearDisplay();
|
||||
void MAX7219_SetBrightness(uint8_t brightness);
|
||||
@@ -4,4 +4,4 @@
|
||||
#define DIGITAL_MQ7 32
|
||||
|
||||
void MQ7_Init();
|
||||
void MQ7_Read();
|
||||
void MQ7_Read(float &sensorVolt, float &RSAir, float &R0, float &sensorValue);
|
||||
@@ -1,8 +1,7 @@
|
||||
#include <Arduino.h>
|
||||
|
||||
#define LED 2
|
||||
#define SERVER_IP "192.168.1.178"
|
||||
#define REST_PORT 80
|
||||
#define SERVER_IP "https://contaminus.miarma.net/api/v1/"
|
||||
#define REST_PORT 443
|
||||
#define MQTT_PORT 1883
|
||||
|
||||
#include "JsonTools.hpp"
|
||||
@@ -10,5 +9,12 @@
|
||||
#include "WifiConnection.hpp"
|
||||
#include "MqttClient.hpp"
|
||||
#include "BME280.hpp"
|
||||
#include "GPS.hpp"
|
||||
#include "MAX7219.hpp"
|
||||
#include "MQ7.hpp"
|
||||
|
||||
uint32_t getChipID();
|
||||
uint32_t getChipID();
|
||||
void prettyReadMQ7();
|
||||
void prettyReadBME280();
|
||||
void prettyReadGPS();
|
||||
void testMatrix();
|
||||
Reference in New Issue
Block a user