Matt Lesslaw
/
MagicMixer
Fertiliser mixing station
main.cpp@1:a1f7cc753866, 2013-10-04 (annotated)
- Committer:
- lawless
- Date:
- Fri Oct 04 22:15:50 2013 +0000
- Revision:
- 1:a1f7cc753866
- Parent:
- 0:34e2166ac5cd
Pumps set with a auto-off timeout. Call it with a number of seconds and it switches itself off afterwards.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lawless | 1:a1f7cc753866 | 1 | #include <vector> |
lawless | 1:a1f7cc753866 | 2 | |
lawless | 0:34e2166ac5cd | 3 | #include "mbed.h" |
lawless | 1:a1f7cc753866 | 4 | #include <FunctionPointer.h> |
lawless | 0:34e2166ac5cd | 5 | |
lawless | 1:a1f7cc753866 | 6 | DigitalOut led1(LED1); |
lawless | 1:a1f7cc753866 | 7 | DigitalOut led2(LED2); |
lawless | 1:a1f7cc753866 | 8 | DigitalOut led3(LED3); |
lawless | 1:a1f7cc753866 | 9 | DigitalOut led4(LED4); |
lawless | 1:a1f7cc753866 | 10 | |
lawless | 1:a1f7cc753866 | 11 | #include "pump.h" |
lawless | 1:a1f7cc753866 | 12 | #include "peristaltics.h" |
lawless | 1:a1f7cc753866 | 13 | #include "flow_controlled.h" |
lawless | 0:34e2166ac5cd | 14 | |
lawless | 0:34e2166ac5cd | 15 | |
lawless | 1:a1f7cc753866 | 16 | int |
lawless | 1:a1f7cc753866 | 17 | main() { |
lawless | 1:a1f7cc753866 | 18 | Peristaltics *peri = new Peristaltics(1); |
lawless | 1:a1f7cc753866 | 19 | Flow_Controlled *flowed = new Flow_Controlled(1); |
lawless | 1:a1f7cc753866 | 20 | |
lawless | 1:a1f7cc753866 | 21 | wait(3); |
lawless | 1:a1f7cc753866 | 22 | |
lawless | 1:a1f7cc753866 | 23 | |
lawless | 1:a1f7cc753866 | 24 | peri->nutrient_a(1); |
lawless | 1:a1f7cc753866 | 25 | peri->nutrient_b(2); |
lawless | 1:a1f7cc753866 | 26 | led4 = 1; |
lawless | 1:a1f7cc753866 | 27 | wait(5); |
lawless | 1:a1f7cc753866 | 28 | led4 = 0; |
lawless | 1:a1f7cc753866 | 29 | |
lawless | 1:a1f7cc753866 | 30 | |
lawless | 1:a1f7cc753866 | 31 | delete peri, flowed; |
lawless | 1:a1f7cc753866 | 32 | |
lawless | 0:34e2166ac5cd | 33 | } |