Project Autus - Automated Plant Chamber

Dependencies:   TextLCD mbed

Fork of keypad_test by Plamen Totev

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) /media/uploads/umairaftab/frdm_-_new_page1.png

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.

/media/uploads/umairaftab/download.png

Revision:
37:892872c3fa96
Parent:
7:1d691f81d455
--- a/led_light/led_lights.cpp	Sun Apr 13 09:06:37 2014 +0000
+++ b/led_light/led_lights.cpp	Mon Apr 14 00:52:14 2014 +0000
@@ -7,6 +7,12 @@
 unsigned int led_pulsewidth = 0;
 unsigned int led_step = 10;
 
+int MAX_RED_LIGHT = 100;
+int MAX_BLUE_LIGHT = 100;
+int MAX_GREEN_LIGHT = 100;
+
+bool led_set_flag= false;
+
 unsigned int pwm_blue_led(int brightness )
 {
     if (brightness==1) {
@@ -47,11 +53,11 @@
 void led_test(void){
     led_blue.period_us(led_period);
     led_blue_pulsewidth=led_pulsewidth;
-    for (int i=1; i<=100; i++) {
+    for (int i=1; i<=MAX_BLUE_LIGHT; i++) {
         pwm_blue_led(1);
         wait (0.1);
     }
-    for (int i=1; i<=100; i++) {
+    for (int i=1; i<=MAX_BLUE_LIGHT; i++) {
         pwm_blue_led(0);
         wait (0.1);
     }
@@ -60,11 +66,11 @@
 
     led_red.period_us(led_period);
     led_red_pulsewidth=led_pulsewidth;
-    for (int i=1; i<=100; i++) {
+    for (int i=1; i<=MAX_RED_LIGHT; i++) {
         pwm_red_led(1);
         wait (0.1);
     }
-    for (int i=1; i<=100; i++) {
+    for (int i=1; i<=MAX_RED_LIGHT; i++) {
         pwm_red_led(0);
         wait (0.1);
     }
@@ -73,14 +79,51 @@
     
     led_green.period_us(led_period);
     led_green_pulsewidth=led_pulsewidth;
-    for (int i=1; i<=100; i++) {
+    for (int i=1; i<=MAX_GREEN_LIGHT; i++) {
         pwm_green_led(1);
         wait (0.1);
     }
-    for (int i=1; i<=100; i++) {
+    for (int i=1; i<=MAX_GREEN_LIGHT; i++) {
         pwm_green_led(0);
         wait (0.1);
     }
     led_green_pulsewidth=10;    // set to 0
     pwm_green_led(0);           // set to 0
+}
+
+void set_leds(){
+    
+    //BLUE
+    led_blue.period_us(led_period);
+    led_blue_pulsewidth=led_pulsewidth;
+    for (int i=1; i<=MAX_BLUE_LIGHT; i++) {
+        pwm_blue_led(1);
+        wait (0.1);
+    }
+    //RED
+    led_red.period_us(led_period);
+    led_red_pulsewidth=led_pulsewidth;
+    for (int i=1; i<=MAX_RED_LIGHT; i++) {
+        pwm_red_led(1);
+        wait (0.1);
+    }
+    //GREEN
+    led_green.period_us(led_period);
+    led_green_pulsewidth=led_pulsewidth;
+    for (int i=1; i<=MAX_GREEN_LIGHT; i++) {
+        pwm_green_led(1);
+        wait (0.1);
+    }
+    led_set_flag = true;
+    
+}
+void turn_off_leds(){
+        
+    led_red_pulsewidth=10;    // set to 0
+    pwm_red_led(0);        
+    led_blue_pulsewidth=10;    // set to 0
+    pwm_blue_led(0);           // set to 0
+    
+    led_green_pulsewidth=10;    // set to 0
+    pwm_green_led(0);  
 }
\ No newline at end of file