55+
Dependencies: BEAR_Protocol_Edited BufferedSerial Debug MaxSonar PID Process QEI UI iSerial mbed
Fork of CleaningMachine_Betago by
move.cpp
- Committer:
- palmdotax
- Date:
- 2016-05-24
- Revision:
- 3:edaab92dbd2f
- Parent:
- 1:45f1573d65a1
File content as of revision 3:edaab92dbd2f:
#include "mbed.h" #include "move.h" DigitalOut dir1(PC_10); DigitalOut dir2(PC_12); PwmOut speeds(PA_5); DigitalOut dirr1(PB_6); DigitalOut dirr2(PC_7); PwmOut speeds2(PA_7); DigitalOut relays(PA_8); void move:: movespeed_1(float setpoint,float spd) { double dc=0; if(setpoint>=0) { dir1=1; dir2=0; } else { dir1=0; dir2=1; } dc=setpoint+spd; speeds.write(dc); } void move:: movespeed_2(float setpoint,float spd) { double dc=0; if(setpoint>=0) { dirr1=1; dirr2=0; } else { dirr1=0; dirr2=1; } dc=setpoint+spd; speeds.write(dc); } void move::pump(int on_off) { relays=on_off; }