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@1:c234f83e4ee3, 2016-02-19 (annotated)
- Committer:
- OlySolano
- Date:
- Fri Feb 19 14:34:37 2016 +0000
- Revision:
- 1:c234f83e4ee3
- Parent:
- 0:bceaaaa8460e
- Child:
- 2:941f7e99e345
pruebas
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| OlySolano | 0:bceaaaa8460e | 1 | #include "mbed.h" |
| OlySolano | 0:bceaaaa8460e | 2 | |
| OlySolano | 1:c234f83e4ee3 | 3 | Serial pc (USBTX, USBRX); |
| OlySolano | 1:c234f83e4ee3 | 4 | //DigitalIn hum(D0); |
| OlySolano | 1:c234f83e4ee3 | 5 | AnalogIn hum(A0); |
| OlySolano | 1:c234f83e4ee3 | 6 | float valor; |
| OlySolano | 1:c234f83e4ee3 | 7 | |
| OlySolano | 0:bceaaaa8460e | 8 | |
| OlySolano | 0:bceaaaa8460e | 9 | int main() { |
| OlySolano | 1:c234f83e4ee3 | 10 | |
| OlySolano | 0:bceaaaa8460e | 11 | while(1) { |
| OlySolano | 1:c234f83e4ee3 | 12 | |
| OlySolano | 1:c234f83e4ee3 | 13 | valor=hum.read(); |
| OlySolano | 1:c234f83e4ee3 | 14 | |
| OlySolano | 1:c234f83e4ee3 | 15 | if(valor <=300){ |
| OlySolano | 1:c234f83e4ee3 | 16 | pc.printf("muy humedo %d\n",valor); |
| OlySolano | 1:c234f83e4ee3 | 17 | } |
| OlySolano | 1:c234f83e4ee3 | 18 | if (valor>300 && valor <=700){ |
| OlySolano | 1:c234f83e4ee3 | 19 | pc.printf ("humedo, no regar %d\n", valor); |
| OlySolano | 1:c234f83e4ee3 | 20 | if (valor>700){ |
| OlySolano | 1:c234f83e4ee3 | 21 | pc.printf("seco %d\n",valor); |
| OlySolano | 1:c234f83e4ee3 | 22 | wait(5.0); |
| OlySolano | 1:c234f83e4ee3 | 23 | }}} |
| OlySolano | 1:c234f83e4ee3 | 24 | |
| OlySolano | 1:c234f83e4ee3 | 25 | } |