fishv6: test all pumps with this code
Dependencies: mbed
Revision 0:c003ab5004eb, committed 2016-03-20
- Comitter:
- alex93
- Date:
- Sun Mar 20 02:58:11 2016 +0000
- Commit message:
- initial commit;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r c003ab5004eb main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Mar 20 02:58:11 2016 +0000 @@ -0,0 +1,35 @@ +/********************************************************************************* +* This code simply creates a pwm value for the BCU motor, valve motor, and pump +* motor. The BCU motor direction is governed by BCU_direction1 and +* BCU_direction2. If connected to a PC terminal, it prints out current readings. +*********************************************************************************/ + +#include "mbed.h" +using namespace std; + +Serial pc(USBTX, USBRX); +AnalogIn valve_current(p19); +AnalogIn bcu_current(p20); +PwmOut valve_pwm(p21); +PwmOut bcu_pwm(p22); +PwmOut motor_pwm(p23); +DigitalOut led2(LED2); +DigitalOut bcu_direction1(p11); +DigitalOut bcu_direction2(p12); + +int main() { + // set serial transfer rate + pc.baud(9600); + + valve_pwm = 0.8; + bcu_pwm = 0.8; + motor_pwm = 0.8; + + led2 = 1; + bcu_direction1 = 0; // BCU_direction1 must not equal BCU_direction2 for the BCU motor to turn + bcu_direction2 = 1; + + while(1) { + pc.printf("valve current percentage: %3.3f%%\n", valve_current.read()*100.0f); + } +} \ No newline at end of file
diff -r 000000000000 -r c003ab5004eb mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Mar 20 02:58:11 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/c0f6e94411f5 \ No newline at end of file