first lib

Dependents:   17robo_fuzi 17robo_tokyo_kaede

Files at this revision

API Documentation at this revision

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
diff -r 000000000000 -r 81eadcca6267 bit_test.cpp
--- /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
diff -r 000000000000 -r 81eadcca6267 bit_test.h
--- /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