42 lines
436 B
C++
42 lines
436 B
C++
//Ultrasone.h
|
|||
|
|
|
||
|
|
#ifndef ULTRASONE_H
|
||
|
|
#define ULTRASONE_H
|
||
|
|
|
||
|
|
#include "Arduino.h"
|
||
|
|
#include "Data.h"
|
||
|
|
#include "Servos.h"
|
||
|
|
#include "Converter.h"
|
||
|
|
|
||
|
|
#define MaxLeft -45
|
||
|
|
#define MaxRight 45
|
||
|
|
|
||
|
|
class Ultrasone
|
||
|
|
{
|
||
|
|
private:
|
||
|
|
Servos SSC32;
|
||
|
|
Converter Con;
|
||
|
|
|
||
|
|
public:
|
||
|
|
void GetRadar(Data *DataLine);
|
||
|
|
|
||
|
|
int CurrentPosition;
|
||
|
|
byte CurrentDirection;
|
||
|
|
|
||
|
|
Ultrasone()
|
||
|
|
{
|
||
|
|
CurrentPosition = 0;
|
||
|
|
CurrentDirection = 0; // Left
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
|
||
|
|
#endif
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|