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.
Dependencies: mbed
function.h
00001 #include "mbed.h" 00002 00003 /////////////////////////////////////// 00004 int led_count1 = 0;//led用のカウンタ 00005 int led_count2 = 0;//led用のカウンタ 00006 int count1 = 0;//フィードバック用のカウンタ 00007 int count2 = 0;//フィードバック用のカウンタ 00008 int distance1 = 0;//右タイヤ 00009 int distance2 = 0;//左タイヤ 00010 int distance = 0;//平均 00011 int c = 0;// 1秒ごとの回転数 00012 int c1 = 0; 00013 int c2 = 0; 00014 00015 Ticker flipper; 00016 00017 void flip1() { 00018 led_count1++; 00019 count1++; 00020 distance1++; 00021 } 00022 00023 void flip2() { 00024 led_count2++; 00025 count2++; 00026 distance2++; 00027 } 00028 00029 void flip3(){ 00030 c = 20*( count1 + count2 ) / 2;//cは1秒ごとのパルス数 00031 c1 = 20*count1; 00032 c2 = 20*count2; 00033 00034 count1 = 0; 00035 count2 = 0; 00036 } 00037 00038 00039 /* 00040 class Sample{ 00041 private: 00042 count; 00043 public: 00044 Sample(); 00045 void counter(); 00046 void counter2(int &num); 00047 }; 00048 00049 Sample::Sample() 00050 { 00051 count=0; 00052 } 00053 00054 void Sample::counter() 00055 { 00056 count++; 00057 } 00058 00059 void Sample::counter2(int& num) 00060 { 00061 num+=1; 00062 } 00063 00064 */
Generated on Sun Sep 18 2022 17:36:26 by
