Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
- Committer:
- OlySolano
- Date:
- 2016-02-23
- Revision:
- 2:941f7e99e345
- Parent:
- 1:c234f83e4ee3
- Child:
- 3:a547a9dec222
File content as of revision 2:941f7e99e345:
#include "mbed.h"
Serial pc (USBTX, USBRX);
DigitalOut bomba(D0);
DigitalOut ledg(LED1);
DigitalOut ledr(LED2);
AnalogIn hum(A0);
float valor,pin;
int main() {
while(1) {
// valor=hum;
valor=hum.read();
valor= valor*1000;
wait (1.0);
if(valor <=500){
pc.printf("humedo %.0f\n",valor);
ledg=0;
bomba=1;
}else{
ledr=1;
}
if (valor>500 && valor<850){
pc.printf("seco %.0f\n",valor);
ledr=0;
bomba=0;
}else{
ledg=1;
}
if(valor>=850){
bomba=1;
}}
}