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
00001 #include "mbed.h" 00002 00003 Serial pc (USBTX, USBRX); 00004 DigitalOut bomba(D2); 00005 DigitalOut ledr(LED1); 00006 DigitalOut ledg(LED2); 00007 AnalogIn hum(A0); 00008 float valor,pin; 00009 00010 00011 int main() { 00012 00013 while(1) { 00014 // valor=hum; 00015 valor=hum.read(); 00016 valor= valor*1000; 00017 wait (1.0); 00018 00019 if(valor <=500){ 00020 pc.printf("humedo %.0f\n",valor); 00021 ledg=0; 00022 bomba=1; 00023 }else{ 00024 ledg=1; 00025 } 00026 if (valor>500 ){ 00027 pc.printf("seco %.0f\n",valor); 00028 ledr=0; 00029 bomba=0; 00030 }else{ 00031 ledr=1; 00032 } 00033 00034 }} 00035
Generated on Wed Jul 20 2022 21:16:57 by
1.7.2