Complete library for whole scientific pre-final
Dependencies: BOX_1
Diff: main.cpp
- Revision:
- 0:f8a9cceb4186
- Child:
- 1:dda01a024d6c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Jun 10 12:50:02 2019 +0000 @@ -0,0 +1,34 @@ +#include "BOX.h" +#include "ENVIROMENTAL.h" +DigitalOut led(LED3); + +BOX m_box (D14,D15,D8,A0,5); +ENVIROMENTAL envi(D14, D15,A1); +int main(){ + //BOX *m_box = new BOX(D1,D2,D3,A0,5); + m_box.initialize(); + while(1) { + int i,j,k; + led = 1; // LED is ON + wait(1); // 200 ms + led = 0; // LED is OFF + wait(0.8); // 800 ms + float t; +t=m_box.get_temp(); //return temperature from DS18B20 + float a; + a=m_box.get_weight(); //return weight in g from hx711 + //m_box->get_resistance();//return soil resistance + m_box.tare(); //sets tare on HX711 library + + //t=m_box.get_resistance(); + printf("temp %f weight %f\n\r",t,a); + t=envi.get_temp(); //return temperature from SI7021 + i=envi.get_humidity(); //return humidity from SI7021 + j=envi.get_pressure(); //return pressure in Pa from MBP280 + a=envi.get_CO(); //return CO from mq-7 + k=envi.get_lux(); //return lux from TSL2561 + printf("temp %f hum %d pres %d co %f lux %d\n\r",t,i,j,a,k); + + } + +} \ No newline at end of file