![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
my new gear...
actuator/airsylinder.cpp@22:394337a4205a, 22 months ago (annotated)
- Committer:
- yootee
- Date:
- Sat Oct 15 07:52:25 2022 +0000
- Revision:
- 22:394337a4205a
- Parent:
- 2:e7b09385d197
upgrade
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yootee | 2:e7b09385d197 | 1 | #include<aircylinder.hpp> |
yootee | 2:e7b09385d197 | 2 | |
yootee | 2:e7b09385d197 | 3 | aircylinder::aircylinder(Port port ,bool push_flag):port_(port),push_flag_(push_flag){ |
yootee | 2:e7b09385d197 | 4 | } |
yootee | 2:e7b09385d197 | 5 | |
yootee | 2:e7b09385d197 | 6 | void aircylinder::push(int cylinder_num){ |
yootee | 2:e7b09385d197 | 7 | if(cylinder_num != 0 || cylinder_num != 1){ |
yootee | 2:e7b09385d197 | 8 | cylinder_num = 0; |
yootee | 2:e7b09385d197 | 9 | } |
yootee | 2:e7b09385d197 | 10 | DigitalOut(port_.pin[cylinder_num], push_flag_); |
yootee | 2:e7b09385d197 | 11 | } |
yootee | 2:e7b09385d197 | 12 | |
yootee | 2:e7b09385d197 | 13 | void aircylinder::pull(int cylinder_num){ |
yootee | 2:e7b09385d197 | 14 | if(cylinder_num != 0 || cylinder_num != 1){ |
yootee | 2:e7b09385d197 | 15 | cylinder_num = 0; |
yootee | 2:e7b09385d197 | 16 | } |
yootee | 2:e7b09385d197 | 17 | DigitalOut(port_.pin[cylinder_num] ,!push_flag_); |
yootee | 2:e7b09385d197 | 18 | } |