#include "stm32f4xx_hal.h" #include "main.h" #include "task.h" #include "string.h" #include "stdio.h" #include "stdlib.h" #include "RTO.h" #include "Lights.h" #include "TemperatureSensor.h" #include "PWM.h" #include "Sensors.h" #include "Serial.h" #include "WiFi.h" #include "HTTPClient.h" #include "JSON.h" //----------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------- using namespace std; namespace HAL = __HAL; namespace MPLABX = mplabx::f4xx_hal; //----------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------- #define RTO_PERIOD_SEC 250 #define WIFI_SSID "Kaibutsu-no-Ue" #define WIFI_PASSWORD "Yaorimon" //----------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------- extern MPLABX::I2C i2c1; extern MPLABX::SPI spi2; //----------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------- void Error(string msg) { Serial.println(msg); HAL_Delay(5000); } void print_sensors_data(void) { Serial.print("Temperature: "); Serial.print(Sensors::temperature); Serial.print(" Pressure: "); Serial.print(Sensors::pressure); Serial.print(" Humidity: "); Serial.print(Sensors::humidity); } //----------------------------------------------------------------------------------------------- void loop() { //Lights::update(); //TemperatureSensor::update(); //PWM::set_duty_cycle(50); //Task::run(); if (RTO::isExpired()) { print_sensors_data(); RTO::reset(); HAL_Delay(100); Task::run(); } HAL_Delay(10); }