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.
Dependents: 00_yotsuba 10_motor-test 00_yotsuba 200_yotsuba_21
line.h
- Committer:
- THtakahiro702286
- Date:
- 2020-01-27
- Revision:
- 0:058a2a20c0d1
- Child:
- 2:fb0d0bb8fc5b
File content as of revision 0:058a2a20c0d1:
#ifndef LINE_H
#define LINE_H
#include "mbed.h"
#define DEFAULT_LINESENSOR_JUDGVALUE 400
/**
* ラインセンサ用クラス
*/
class Line{
public:
/**
* デフォルトコンストラクタ
*/
Line(PinName line_);
Line(PinName line_, float border_);
/**
*ラインとの境目の位置
*/
void border(float border_);
/**
*ラインの判別表示
*1だとライン踏んでいる
*0だとラインを踏んでいない
*/
bool judg();
/**
*センサの値表示
*/
float value();
operator bool();
private:
AnalogIn linesensor;
float linevalue, lineborder;
Thread thread;
void lineassemble();
bool judgvalue;
};
#endif