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:
7:1d691f81d455
Parent:
3:087ce66714c0
Child:
37:892872c3fa96
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/led_light/led_lights.cpp	Fri Apr 11 03:50:38 2014 +0000
@@ -0,0 +1,86 @@
+#include "mbed.h"
+#include "led_lights.h"
+unsigned int led_red_pulsewidth;
+unsigned int led_green_pulsewidth;
+unsigned int led_blue_pulsewidth;
+unsigned int led_period =1000;
+unsigned int led_pulsewidth = 0;
+unsigned int led_step = 10;
+
+unsigned int pwm_blue_led(int brightness )
+{
+    if (brightness==1) {
+        led_blue_pulsewidth=led_blue_pulsewidth+led_step;
+        led_blue.pulsewidth_us(led_blue_pulsewidth);
+    };
+    if (brightness==0) {
+        led_blue_pulsewidth=led_blue_pulsewidth-led_step;
+        led_blue.pulsewidth_us(led_blue_pulsewidth);
+    };
+    return led_blue_pulsewidth;
+}
+unsigned int pwm_green_led(int brightness)
+{
+    if (brightness==1) {
+        led_green_pulsewidth=led_green_pulsewidth+led_step;
+        led_green.pulsewidth_us(led_green_pulsewidth);
+    }
+    if (brightness==0) {
+        led_green_pulsewidth=led_green_pulsewidth-led_step;
+        led_green.pulsewidth_us(led_green_pulsewidth);
+    }
+    return led_green_pulsewidth;
+}
+unsigned int pwm_red_led(int brightness)
+{
+    if (brightness==1) {
+        led_red_pulsewidth=led_red_pulsewidth+led_step;
+        led_red.pulsewidth_us(led_red_pulsewidth);
+    }
+    if (brightness==0) {
+        led_red_pulsewidth=led_red_pulsewidth-led_step;
+        led_red.pulsewidth_us(led_red_pulsewidth);
+    }
+    return led_red_pulsewidth;
+}
+
+void led_test(void){
+    led_blue.period_us(led_period);
+    led_blue_pulsewidth=led_pulsewidth;
+    for (int i=1; i<=100; i++) {
+        pwm_blue_led(1);
+        wait (0.1);
+    }
+    for (int i=1; i<=100; i++) {
+        pwm_blue_led(0);
+        wait (0.1);
+    }
+    led_blue_pulsewidth=10;    // set to 0
+    pwm_blue_led(0);           // set to 0
+
+    led_red.period_us(led_period);
+    led_red_pulsewidth=led_pulsewidth;
+    for (int i=1; i<=100; i++) {
+        pwm_red_led(1);
+        wait (0.1);
+    }
+    for (int i=1; i<=100; i++) {
+        pwm_red_led(0);
+        wait (0.1);
+    }
+    led_red_pulsewidth=10;    // set to 0
+    pwm_red_led(0);           // set to 0
+    
+    led_green.period_us(led_period);
+    led_green_pulsewidth=led_pulsewidth;
+    for (int i=1; i<=100; i++) {
+        pwm_green_led(1);
+        wait (0.1);
+    }
+    for (int i=1; i<=100; i++) {
+        pwm_green_led(0);
+        wait (0.1);
+    }
+    led_green_pulsewidth=10;    // set to 0
+    pwm_green_led(0);           // set to 0
+}
\ No newline at end of file