Last change
on this file since 429 was 136, checked in by ertl-honda, 9 years ago |
ライブラリとOS及びベーシックなサンプルの追加.
|
File size:
891 bytes
|
Rev | Line | |
---|
[136] | 1 | #ifndef LINE_FOLLOW_H
|
---|
| 2 | #define LINE_FOLLOW_H
|
---|
| 3 |
|
---|
| 4 | #if ARDUINO >= 100
|
---|
| 5 | #include "Arduino.h"
|
---|
| 6 | #else
|
---|
| 7 | #include "WProgram.h"
|
---|
| 8 | #endif
|
---|
| 9 |
|
---|
| 10 | class LineFollow{
|
---|
| 11 | public:
|
---|
| 12 | LineFollow();
|
---|
| 13 |
|
---|
| 14 | void calibIRs();
|
---|
| 15 | void runLineFollow();
|
---|
| 16 | void config(uint8_t KP, uint8_t KD, uint8_t robotSpeed, uint8_t intergrationTime);
|
---|
| 17 |
|
---|
| 18 | //These are all pure virtual functions, pure VF needs pure specifier "=0"
|
---|
| 19 | //virtual void motorsWrite(int speedL, int speedR)=0;
|
---|
| 20 | virtual void motorsWritePct(int speedLpct, int speedRpct)=0;
|
---|
| 21 | virtual void motorsStop()=0;
|
---|
| 22 | virtual int _IRread(uint8_t num)=0;
|
---|
| 23 | protected:
|
---|
| 24 | virtual void reportActionDone()=0;
|
---|
| 25 |
|
---|
| 26 | private:
|
---|
| 27 | void doCalibration(int speedPct, int time);
|
---|
| 28 | void ajusta_niveles();
|
---|
| 29 |
|
---|
| 30 | uint8_t KP;
|
---|
| 31 | uint8_t KD;
|
---|
| 32 | uint8_t robotSpeed; //percentage
|
---|
| 33 | uint8_t intergrationTime;
|
---|
| 34 |
|
---|
| 35 | int lectura_sensor[5], last_error, acu;
|
---|
| 36 | int sensor_blanco[5];
|
---|
| 37 | int sensor_negro[5];
|
---|
| 38 | };
|
---|
| 39 |
|
---|
| 40 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.