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

weight/weight.cpp

Committer:
umairaftab
Date:
2014-04-14
Revision:
57:7ab93ed49b70
Parent:
14:72176f1e4907

File content as of revision 57:7ab93ed49b70:

#include "mbed.h"
#include "weight.h"
static const int MAX_DATAPOINTS=500;
static const float MAX_ADC_VALUE=65535;

unsigned short current_weight_1=0;
unsigned int current_weight_1_int=0;
unsigned short CMA_weight1=0;
unsigned int dead_load=32500;
float weight1=0;
void read_weight(){
    int count =0; 
    while(count<MAX_DATAPOINTS){
        
        current_weight_1 = weight_sense1.read_u16();
        
        CMA_weight1 =  (current_weight_1 + (count*CMA_weight1))/(count+1);
        wait_ms(5);
        count++;    
    }
CMA_weight1=CMA_weight1-dead_load;
}

void calc_weight(){
    weight1 = (float)CMA_weight1/MAX_ADC_VALUE;    
    //printf("%d -> weightsensor=%4.4f\n\r",CMA_weight1,weight1);
}