first lib
Dependents: 17robo_fuzi 17robo_tokyo_kaede
Revision 0:81eadcca6267, committed 2017-09-24
- Comitter:
- echo_piyo
- Date:
- Sun Sep 24 05:24:41 2017 +0000
- Commit message:
- ????2??
Changed in this revision
bit_test.cpp | Show annotated file Show diff for this revision Revisions of this file |
bit_test.h | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bit_test.cpp Sun Sep 24 05:24:41 2017 +0000 @@ -0,0 +1,8 @@ +#include "bit_test.h" +#include "mbed.h" + +int bitTest(int dataByte, int bitNumber) { + dataByte = dataByte >> bitNumber; + dataByte = dataByte & 1; + return dataByte; +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bit_test.h Sun Sep 24 05:24:41 2017 +0000 @@ -0,0 +1,13 @@ +/**************************************** +int bit_test(int data, int bit_number); +データのビットが1なら1を返す +****************************************/ + +#ifndef MBED_BIT_TEST_H +#define MBED_BIT_TEST_H + +#include "mbed.h" + +int bitTest(int dataByte, int bitNumber); + +#endif \ No newline at end of file