![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
my new gear...
Diff: actuator/airsylinder.cpp
- Revision:
- 2:e7b09385d197
diff -r 744e1f66d5dc -r e7b09385d197 actuator/airsylinder.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/actuator/airsylinder.cpp Sun Mar 27 04:39:16 2022 +0000 @@ -0,0 +1,18 @@ +#include<aircylinder.hpp> + +aircylinder::aircylinder(Port port ,bool push_flag):port_(port),push_flag_(push_flag){ +} + +void aircylinder::push(int cylinder_num){ + if(cylinder_num != 0 || cylinder_num != 1){ + cylinder_num = 0; + } + DigitalOut(port_.pin[cylinder_num], push_flag_); +} + +void aircylinder::pull(int cylinder_num){ + if(cylinder_num != 0 || cylinder_num != 1){ + cylinder_num = 0; + } + DigitalOut(port_.pin[cylinder_num] ,!push_flag_); +} \ No newline at end of file