STM32F103C8T6_WIFI_Heating_system
Dependencies: mbed mbed-STM32F103C8T6 eeprom_flash Watchdog PinDetect DS1820
- Bluepill STM32F103C8T6 Heating system
- _This project is core part of bigger heating system project!_
Features
- Reading temperature from four DS18B20 sensors
- Making a decision about switching on/off heater and pomp
- Executing simple user commands from UART
- Storing state parameters to program memory (EEPROM emulation)
Diff: main.cpp
- Revision:
- 39:aa5f95061409
- Parent:
- 38:a0753c2a4497
- Child:
- 41:978c2d85a0e7
--- a/main.cpp Tue Sep 18 20:49:05 2018 +0000 +++ b/main.cpp Fri Sep 21 17:56:25 2018 +0000 @@ -17,7 +17,7 @@ Watchdog wd; unsigned int eeprom_config_value; -Serial pc(PA_2, PA_3); +Serial pc(PA_2, PA_3); // (TX, RX) Pin definition char a[128] = ""; // RX command buffer char i = 0; // RX char pointer static char recieved = 0; @@ -63,7 +63,6 @@ }; - void at_command(){ if (recieved == 1) { @@ -77,12 +76,12 @@ //pc.printf(a); pc.printf("RAM=%u FLASH=%u OK\r\n", eeprom_config_value, readEEPROMWord(0)); } else { - pc.printf("Wrong AT command\r\n"); + pc.printf("Wrong command\r\n"); }; //readEEPROMWord(0x01); } else { - pc.printf("Wrong request\r\n"); + pc.printf("Bad request\r\n"); }; // process_command(a); @@ -95,6 +94,7 @@ i = 0; }; }; + int main() { @@ -117,7 +117,7 @@ pc.attach(&rxCallback, Serial::RxIrq); pc.baud(115200); - pc.printf("\r\n\r\nWifi Heating system\r\n"); + pc.printf("\r\nNaumovich 2.0\r\n"); pomp_OFF = 0; @@ -137,6 +137,7 @@ queue.call( start_temp ); queue.call_every(100, at_command); queue.call_every(2000, check_temp); + queue.call_every(3000, process_temp); // Start queue queue.dispatch();