firstaa
Dependents: 17robo_fuzi 17robo_tokyo_kaede
cylinder.cpp
- Committer:
- echo_piyo
- Date:
- 2017-09-20
- Revision:
- 0:46dd0245886c
- Child:
- 1:d4fa6f96bab5
File content as of revision 0:46dd0245886c:
#include "cylinder.h" #include "mbed.h" Cylinder::Cylinder(PinName pin_in,PinName pin_out):cylinder_in(pin_in),cylinder_out(pin_out){ cylinder_in = 1; cylinder_out = 0; } void Cylinder::cyclic(int state){ if(state) { if(flag == false) { cylinder_in = !cylinder_in; cylinder_out = !cylinder_out; } flag = true; } else flag = false; } int Cylinder::getInState(){ return (int)cylinder_in; } int Cylinder::getOutState(){ return (int)cylinder_out; }