Project Autus - Automated Plant Chamber
Fork of keypad_test by
Autus
This is the codebase accompanying the project Autus.
Autus is an automated growth chamber for plants.
Features
Control Humidity inside chamber wrt to external humidity. Control Temperature inside chamber. ( Peltier Heaters/Coolers ) Water and shower plants. Control soil humidity. Monitor water tanks level (Load Cell)
Code Base Features
Fixed timing and CRC for DHT-11 Sensor. Fixed OneWire bug for ds18b20
Cyclic Executive Scheduler with Priority. Async IPC framework for PC App over bluetooth
Fake RTC systick, I was having some trouble with the on board rtc.
Diff: main.cpp
- Revision:
- 54:1302a97c84aa
- Parent:
- 53:12b7f7b23a31
- Child:
- 55:0bfa6b62a66b
diff -r 12b7f7b23a31 -r 1302a97c84aa main.cpp --- a/main.cpp Mon Apr 14 11:20:23 2014 +0000 +++ b/main.cpp Mon Apr 14 15:49:59 2014 +0000 @@ -38,6 +38,10 @@ #include <string> using namespace std; +#define BAUDRATE0 1200 +#define BAUDRATE1 2400 +#define BAUDRATE3 2400 + //SERIAL Serial bluetooth_dev(PTA2, PTA1); // tx, rx Serial printer(PTC4,PTC3); // tx, rx @@ -107,6 +111,30 @@ } +void printer_print_values(){ + + printf("\n\r**Autus Sensor Values**\n\r"); + wait(1); + printer.printf("Chamber Temp: %4.2f\n\r",inside_temp); + wait(1); + printer.printf("Chamber Humidity: %4.2f\n\r",inside_humidity); + wait(1); + printer.printf("Chamber Dewpoint: %4.2f\n\r",inside_dewpoint); + wait(1); + printer.printf("External Temp: %4.2f\n\r",outside_temp); + wait(1); + printer.printf("External Humidity: %4.2f\n\r",outside_humidity); + wait(1); + printer.printf("External Dewpoint: %4.2f\n\r",outside_dewpoint); + wait(1); + printer.printf("Soil Moisture-1: %4.2f\n\r",soil1_humid); + wait(1); + printer.printf("Soil Moisture-2: %4.2f\n\r",soil2_humid); + wait(1); + printer.printf("Load Cell: %4.2f\n\r",weight_sensor); + wait(1); + printer.printf("\n\r*****END*****\n\r"); +} //**************************FUNCTION TO READ SENSORS ********************************************** void read_sensors(){ @@ -542,7 +570,14 @@ bluetooth_dev.baud(9600); bluetooth_dev.attach(&callback_bluetooth); - + wait(2); + lcd.cls(); + lcd.locate(0,0); + lcd.printf("Initialize Printer"); + printer.baud(BAUDRATE0); + printer.format(8,Serial::None,1); + printer.printf("Autus Ready\n\r"); + //printer_print_values(); wait(5); lcd.cls(); ui_current_screen = 1; @@ -650,6 +685,9 @@ if(keypad_value == 84){ pelt_keypad_enable=true; } + if(keypad_value == 78){ + printer_print_values(); + } //printf("%d\n\r",keypad_value); // -> Key pressed @@ -686,6 +724,7 @@ peltierin_temp = dsen_temp_in; peltierout_temp = dsen_temp_out; sensor_function_call_time=::min; + printer_print_values(); lcd.cls(); } /**********************PELTIER CALLER************************************************************************/