This is a Testing program
Dependencies: DHT DS18B20 Decagon10HS DecagonEC-5 FastIO LightSensorALS-PT19 WaterMark200ss WeatherMeters mbed-src
Revision 0:232c507002f4, committed 2016-11-28
- Comitter:
- javiersing
- Date:
- Mon Nov 28 13:28:26 2016 +0000
- Commit message:
- This is a Testing program
Changed in this revision
diff -r 000000000000 -r 232c507002f4 DHT.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DHT.lib Mon Nov 28 13:28:26 2016 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/users/javiersing/code/DHT/#946ecc42b731
diff -r 000000000000 -r 232c507002f4 DS18B20.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DS18B20.lib Mon Nov 28 13:28:26 2016 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/users/javiersing/code/DS18B20/#435141e08516
diff -r 000000000000 -r 232c507002f4 Decagon10HS.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Decagon10HS.lib Mon Nov 28 13:28:26 2016 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/users/javiersing/code/Decagon10HS/#ab240102b895
diff -r 000000000000 -r 232c507002f4 DecagonEC-5.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DecagonEC-5.lib Mon Nov 28 13:28:26 2016 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/users/javiersing/code/DecagonEC-5/#65f4dc94f339
diff -r 000000000000 -r 232c507002f4 FastIO.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FastIO.lib Mon Nov 28 13:28:26 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/Sissors/code/FastIO/#45b32f07e790
diff -r 000000000000 -r 232c507002f4 LightSensorALS-PT19.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LightSensorALS-PT19.lib Mon Nov 28 13:28:26 2016 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/users/javiersing/code/LightSensorALS-PT19/#eae38e61d806
diff -r 000000000000 -r 232c507002f4 WaterMark200ss.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/WaterMark200ss.lib Mon Nov 28 13:28:26 2016 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/users/javiersing/code/WaterMark200ss/#8db346e7a51a
diff -r 000000000000 -r 232c507002f4 WeatherMeters.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/WeatherMeters.lib Mon Nov 28 13:28:26 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/AdamGreen/code/WeatherMeters/#457832d52954
diff -r 000000000000 -r 232c507002f4 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Nov 28 13:28:26 2016 +0000 @@ -0,0 +1,90 @@ +#include "mbed.h" +#include "LightSensor.h" +#include "Decagon10HS.h" +#include "DecagonEC-5.h" +#include "DHT.h" +#include "FastIO.h" +#include "DS18B20.h" +#include "WaterMark200ss.h" +#include "WeatherMeters.h" +#include "Anemometer.h" + + +//Declaración de Puertos para cada sensor +AnalogIn moisture10HS(A0); //Decagon 10HS en el A0 +AnalogIn light(A1); //ALS-PT19LIGHT en el A1 +AnalogIn moistureEC5(A2); //Decagon EC-5 en el A2 +AnalogIn lightref(A3); //Referencia 3.3V en el A3 +AnalogIn moisture200ss(A4); //WaterMark200ss en el A4 + +/*El sensor DS18B20 se +define el pin en la +librería DHT*/ //Ds18B20 en el D2 +DHT dht22(PB_3,DHT22); //DHT22 en el D3 +CWeatherMeters WeatherMeters(D4, D5, A5); //Weather Station Anemómetro D4, Veleta D5, Pluviómetro A5 + + + +//Declaración variables para sensores: +float lightLvl = 0; // Sensor LUZ +float VWC10HS = 0; // Sensor 10HS +float VWCEC5 = 0; // Sensor EC-5 +float tempdht22 = 0; // Sensor DHT22 +float humdht22 = 0; // Sensor DHT22 +float tempDS18B20 = 0; // Sensor DS18B20 +float centibar = 0; // Snsor WaterMark 200ss +float rainfall = 0; +float windSpeed = 0; +float maxWindSpeed = 0; + + + +int main() +{ + pc.baud(115200); + DQ.output(); + DQ = 0; + DQ.input(); + pc.printf("All Sensors Test \r\n"); + pc.printf("Memory allocated for %d DS18B20.\r\n",MaxROMs); + pc.printf("Scanning for devices...\r\n"); + ow_reset(); + FindDevices(); + pc.printf("Scanning completed.\r\n"); + + + while(1) { + //Leer Sensores + wait(1); + lightLvl = readLightSensor(light,lightref); //Sensor de Luz + VWC10HS = Moist10HS(moisture10HS); //Sensor 10HS + VWCEC5 = MoistEC5(moistureEC5); //Sensor EC-5 + tempdht22 = dht22.ReadTemperature(CELCIUS); //Sensor DHT22 + humdht22 = dht22.ReadHumidity(); //Sensor DHT22 + centibar = Moist200ss(moisture200ss); //Sensor WaterMark 200ss + CWeatherMeters::SMeasurements Measurements; //Weather Station + WeatherMeters.GetMeasurements(&Measurements); //Weather Station + rainfall = Measurements.Rainfall; //Weather Station + windSpeed = Measurements.WindSpeed; //Weather Station + maxWindSpeed = Measurements.MaximumWindSpeed; //Weather Station + pc.printf("Direction: %s\n", Measurements.WindDirectionString); + pc.printf("Depth: %f\n",rainfall); + pc.printf("Current speed: %f\n", windSpeed); + pc.printf("Maximum speed: %f\n", maxWindSpeed); + pc.printf("200ss Centibar: %2.2f\n", centibar); + pc.printf("DHT22 Humidity: %.1f \n\r",humdht22); + pc.printf("DHT22 Temp: %.1f C",tempdht22); + pc.printf("EC-5 VWC: %2.2f VMC\r\n", VWCEC5); + pc.printf("10HS VWC: %2.2f\r\n", VWC10HS); + pc.printf("Light: %3.2f \r\n", lightLvl); + ConvT(); // Todos los DS18B20 inician la conversión a temp + wait_ms(750); // Tiempo minimo de conversion a 12-bit + for(int i=1; i<=numROMs; i++) { // Bucle para todos los DS18B20 + tempDS18B20 = Get_Temp(i); + pc.printf("DS18B20 Temp: %08.4f Device: %02X%02X%02X%02X%02X%02X %03d\r\n",tempDS18B20,FoundROM[i][6],FoundROM[i][5],FoundROM[i][4],FoundROM[i][3],FoundROM[i][2],FoundROM[i][1],i); + } + pc.printf("\r\n"); + wait(5.0f); + } +} +
diff -r 000000000000 -r 232c507002f4 mbed-src.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-src.lib Mon Nov 28 13:28:26 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed-src/#a11c0372f0ba