sampleProgram
Dependencies: QEI accelerator bit_test cyclic_io cyclic_var cylinder event_var limit mbed mecanum motor_drive pid pid_encoder rs422_put sbdbt servo
Fork of 17robo_fuzi by
cyclic.h@14:aac2f18f6779, 2017-08-04 (annotated)
- Committer:
- echo_piyo
- Date:
- Fri Aug 04 00:16:44 2017 +0000
- Revision:
- 14:aac2f18f6779
- Child:
- 32:f535ace7c529
???????????????????????????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
echo_piyo | 14:aac2f18f6779 | 1 | class Cyclic |
echo_piyo | 14:aac2f18f6779 | 2 | { |
echo_piyo | 14:aac2f18f6779 | 3 | public: |
echo_piyo | 14:aac2f18f6779 | 4 | void cyclic(int state_in) |
echo_piyo | 14:aac2f18f6779 | 5 | { |
echo_piyo | 14:aac2f18f6779 | 6 | if(state_in) |
echo_piyo | 14:aac2f18f6779 | 7 | { |
echo_piyo | 14:aac2f18f6779 | 8 | if(flag == false) |
echo_piyo | 14:aac2f18f6779 | 9 | { |
echo_piyo | 14:aac2f18f6779 | 10 | state = !state; |
echo_piyo | 14:aac2f18f6779 | 11 | } |
echo_piyo | 14:aac2f18f6779 | 12 | flag = true; |
echo_piyo | 14:aac2f18f6779 | 13 | } |
echo_piyo | 14:aac2f18f6779 | 14 | else flag = false; |
echo_piyo | 14:aac2f18f6779 | 15 | } |
echo_piyo | 14:aac2f18f6779 | 16 | |
echo_piyo | 14:aac2f18f6779 | 17 | int getState() |
echo_piyo | 14:aac2f18f6779 | 18 | { |
echo_piyo | 14:aac2f18f6779 | 19 | return state; |
echo_piyo | 14:aac2f18f6779 | 20 | } |
echo_piyo | 14:aac2f18f6779 | 21 | |
echo_piyo | 14:aac2f18f6779 | 22 | private: |
echo_piyo | 14:aac2f18f6779 | 23 | bool flag; |
echo_piyo | 14:aac2f18f6779 | 24 | bool state; |
echo_piyo | 14:aac2f18f6779 | 25 | }; |