Scientific task box V1

Dependencies:   HX711 DS1820

Dependents:   Scientific_RTOS Scientific_RTOS

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers BOX.h Source File

BOX.h

00001 #ifndef BOX_H
00002 #define BOX_H
00003 
00004 #include "mbed.h"
00005 #include "HX711.h"
00006 #include "DS1820.h"
00007 
00008 
00009 
00010 class BOX
00011 { 
00012 public:
00013   BOX (PinName pinCLK_HX711, PinName pinDAT_HX711,PinName pin_temp, PinName pin_cond,int HX711_coefficent,PinName pin_servo);
00014   float get_temp();    //return temperature from DS18B20
00015   int get_weight();    //return weight in g from hx711
00016   int get_resistance();//return voltage on resistor then :
00017                        //current = (1 - meas_v) / (2000000); kvl and V/R to get current
00018                        //resist = (meas_v / current);    Ohm law gives us the soil resistence 
00019   void move_servo(float ang);
00020   void tare(unsigned char times=20);         //sets tare on HX711 library
00021   void initialize();
00022   
00023   
00024   
00025 virtual ~BOX();
00026 
00027 
00028 
00029 private:
00030 
00031 PinName _pinCLK;
00032 PinName  _pinDAT;
00033 PinName  _pintemp;
00034 PinName _pincond;
00035 int _coefficent;
00036 float  _tmp;
00037 DS1820 ds1820; // Dallas 1-wire
00038 HX711 balance;
00039 bool check;
00040 PwmOut servo;
00041 
00042 };
00043 
00044 #endif