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.
UI/ui.cpp
- Committer:
- umairaftab
- Date:
- 2014-04-11
- Revision:
- 7:1d691f81d455
- Parent:
- 5:bf31a58915a5
- Child:
- 11:f9ffd5ab7e94
File content as of revision 7:1d691f81d455:
#include "mbed.h" //#include "keypad.h" //#include "globalvalues.h" #include "ui.h" #include "airhumidity.h" //for error variables char lcd_keypad_value ; int temp_unit = 0; //0 for celcius 1 for faren 2 for kelvin char temp_unit_char = 'C'; float outside_humidity; float outside_temp; float outside_dewpoint; float inside_humidity; float inside_temp; float inside_dewpoint; float soil1_humidity; float soil2_humidity; //Set Temperature Unit void set_temp_unit(){ if(temp_unit == 1){ temp_unit_char = 'F'; } else if(temp_unit == 2){ temp_unit_char = 'K'; } else{ temp_unit_char = 'C'; } } void ui_startup(){ lcd.cls(); lcd.setCursor(TextLCD::CurOff_BlkOn); lcd.locate(0,0); lcd.printf("Project Autus"); lcd.locate(0,1); lcd.printf("Initializing Machine"); } void ui_screen1() { set_temp_unit(); lcd.cls(); lcd.setCursor(TextLCD::CurOff_BlkOn); lcd.locate(0,0); lcd.printf("T: %3.1f%c",inside_temp,temp_unit_char); lcd.printf(" H: %3.1f",inside_humidity); lcd.locate(0,1); lcd.printf("S1: %3.1f",soil1_humidity); lcd.printf(" S2: %3.1f",soil2_humidity); } void ui_screen2() { set_temp_unit(); lcd.cls(); lcd.setCursor(TextLCD::CurOff_BlkOn); lcd.locate(0,0); lcd.printf("iT: %3.1f%c",inside_temp,temp_unit_char); lcd.printf(" iH: %3.1f",inside_humidity); lcd.locate(0,1); lcd.printf("oT: %3.1f%c",outside_temp,temp_unit_char); lcd.printf(" oH: %3.1f",outside_humidity); } void ui_screen3() { //set_temp_unit(); lcd.cls(); lcd.setCursor(TextLCD::CurOff_BlkOn); lcd.locate(0,0); lcd.printf("iT: %3.1f%c",inside_temp,temp_unit_char); lcd.printf(" iH: %3.1f",inside_humidity); lcd.locate(0,1); lcd.printf("oT: %3.1f%c",outside_temp,temp_unit_char); lcd.printf(" oH: %3.1f",outside_humidity); }