111

Dependencies:   BufferedSerial FastPWM mbed

Committer:
sbh9428
Date:
Tue Apr 12 06:52:10 2016 +0000
Revision:
0:f3108add3d98
11

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sbh9428 0:f3108add3d98 1 /*
sbh9428 0:f3108add3d98 2 * pumpt.cpp
sbh9428 0:f3108add3d98 3 *
sbh9428 0:f3108add3d98 4 * Created on: 2016. 4. 11.
sbh9428 0:f3108add3d98 5 * Author: right
sbh9428 0:f3108add3d98 6 */
sbh9428 0:f3108add3d98 7
sbh9428 0:f3108add3d98 8 #include "pumpt.h"
sbh9428 0:f3108add3d98 9
sbh9428 0:f3108add3d98 10 pump_t::pump_t() {
sbh9428 0:f3108add3d98 11 // TODO Auto-generated constructor stub
sbh9428 0:f3108add3d98 12
sbh9428 0:f3108add3d98 13 }
sbh9428 0:f3108add3d98 14
sbh9428 0:f3108add3d98 15 pump_t::pump_t(FastPWM *_out)
sbh9428 0:f3108add3d98 16 {
sbh9428 0:f3108add3d98 17 out=_out;
sbh9428 0:f3108add3d98 18 out->period_ms(1);
sbh9428 0:f3108add3d98 19 }
sbh9428 0:f3108add3d98 20
sbh9428 0:f3108add3d98 21 pump_t::~pump_t() {
sbh9428 0:f3108add3d98 22 // TODO Auto-generated destructor stub
sbh9428 0:f3108add3d98 23 }
sbh9428 0:f3108add3d98 24
sbh9428 0:f3108add3d98 25 void pump_t::setPWM(float PWMvalue)
sbh9428 0:f3108add3d98 26 {
sbh9428 0:f3108add3d98 27 out->pulsewidth_us(1000*PWMvalue);
sbh9428 0:f3108add3d98 28 }
sbh9428 0:f3108add3d98 29