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.
Diff: main.cpp
- Revision:
- 2:66ab94f69a1a
- Parent:
- 1:48d05483fffc
- Child:
- 3:7e158df628f1
--- a/main.cpp Thu Apr 11 22:09:50 2019 +0000 +++ b/main.cpp Wed Apr 24 04:35:34 2019 +0000 @@ -10,8 +10,20 @@ AnalogIn sense3(p19); AnalogIn sense4(p20); +DigitalOut pump(p21); + +AnalogIn sense(p15); + int main() { + char pumpOn = 0; + pump.write(1); while(1) { + + float s = sense.read(); + printf("%1.2f\n", s); + wait(1); + + /* myled = 1; wait(0.2); myled = 0; @@ -29,13 +41,24 @@ printf(" | %1.2f", se3); printf(" | %1.2f", se4); float sum = se0 + se1 + se2 + se3 + se4; - if (sum > 4.94) { + if (sum > 4.85) { printf("|bacK\n"); - } else if (sum > 1.0) { + } else if (sum > 2.5) { printf("|sIDE\n"); } else { printf("|no\n"); } wait(1); + */ + + /* + if (pumpOn) { + pump = 0; + pumpOn = 0; + } else { + pump = 1; + pumpOn = 1; + } + */ } }