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.
solano.h
00001 #include "mbed.h" 00002 00003 Serial pc (USBTX, USBRX); 00004 DigitalOut bomba(D0); 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 //pc.printf("%.0f\n",valor); 00018 wait (1.0); 00019 00020 if(valor <=500){ 00021 pc.printf("humedo %.0f\n",valor); 00022 ledr=0; 00023 bomba=0; 00024 }else{ 00025 ledr=1; 00026 } 00027 if (valor>500){ 00028 pc.printf("seco %.0f\n",valor); 00029 ledg=0; 00030 }else{ 00031 ledg=1; 00032 bomba=1; 00033 }} 00034 00035 }
Generated on Wed Jul 20 2022 21:16:57 by
1.7.2