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
headerfile_unuse/bit_test_.h@76:03475cafb326, 2017-10-22 (annotated)
- Committer:
- echo_piyo
- Date:
- Sun Oct 22 11:26:25 2017 +0000
- Revision:
- 76:03475cafb326
- Parent:
- 66:1664ee92539d
(??)????shoulderCalclation???controllerEvent???output?????; ????????????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
echo_piyo | 0:bf96e953cdb8 | 1 | /* |
echo_piyo | 0:bf96e953cdb8 | 2 | int bit_test(int data, int bit_number); |
echo_piyo | 0:bf96e953cdb8 | 3 | データのビットが1なら1を返す |
echo_piyo | 0:bf96e953cdb8 | 4 | */ |
echo_piyo | 0:bf96e953cdb8 | 5 | |
echo_piyo | 0:bf96e953cdb8 | 6 | int bit_test(int data_byte, int bit_number) { |
echo_piyo | 0:bf96e953cdb8 | 7 | data_byte = data_byte >> bit_number; |
echo_piyo | 0:bf96e953cdb8 | 8 | data_byte = data_byte & 0b00000001; |
echo_piyo | 0:bf96e953cdb8 | 9 | return data_byte; |
echo_piyo | 0:bf96e953cdb8 | 10 | } |