Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: function.h
- Revision:
- 4:45b45e8ca173
- Child:
- 7:de699a50fc63
diff -r 10bf740dc758 -r 45b45e8ca173 function.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/function.h Mon Dec 17 05:55:01 2018 +0000
@@ -0,0 +1,65 @@
+#include "mbed.h"
+
+///////////////////////////////////////
+int led_count1 = 0;//led用のカウンタ
+int led_count2 = 0;//led用のカウンタ
+int count1 = 0;//フィードバック用のカウンタ
+int count2 = 0;//フィードバック用のカウンタ
+int distance1 = 0;//右タイヤ
+int distance2 = 0;//左タイヤ
+int distance = 0;//平均
+int c = 0;// 1秒ごとの回転数
+int c1 = 0;//右の回転数
+int c2 = 0;//左の回転数
+
+
+Ticker flipper;
+
+void flip1() {
+ led_count1++;
+ count1++;
+ distance1++;
+}
+
+void flip2() {
+ led_count2++;
+ count2++;
+ distance2++;
+}
+
+void flip3(){
+ c = 20*( count1 + count2 ) / 2;//cは1秒ごとのパルス数
+ c1 = 20*count1;
+ c2 = 20*count2;
+
+ count1 = 0;
+ count2 = 0;
+ }
+
+
+/*
+class Sample{
+ private:
+ count;
+ public:
+ Sample();
+ void counter();
+ void counter2(int &num);
+};
+
+Sample::Sample()
+{
+ count=0;
+}
+
+void Sample::counter()
+{
+ count++;
+}
+
+void Sample::counter2(int& num)
+{
+ num+=1;
+}
+
+*/
\ No newline at end of file