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
- Committer:
- isshikiyuya
- Date:
- 2018-12-20
- Revision:
- 4:282471928d78
- Parent:
- 0:7a6b6c687fa3
File content as of revision 4:282471928d78:
#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 = ( count1 + count2 )*20 / 2;//cは1秒ごとのパルス数
c1 = count1 * 20;
c2 = count2 * 20;
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;
}
*/