2019-11-18 18:11:26 +01:00
|
|
|
#pragma once
|
2020-01-20 18:57:14 +01:00
|
|
|
#define startp 105
|
|
|
|
#define endp 115
|
2020-01-27 17:05:39 +01:00
|
|
|
//Coords are mapped from 0 up to this value
|
|
|
|
#define MAP_MAX 100
|
|
|
|
#define HALF_MAP_MAX 50
|
2020-01-20 18:57:14 +01:00
|
|
|
//#define unkn 0b01101001
|
2019-11-18 17:15:32 +01:00
|
|
|
#include "data_source.h"
|
|
|
|
|
2020-01-29 18:56:49 +01:00
|
|
|
class DataSourceCameraConic : public DataSource{
|
2019-11-18 17:15:32 +01:00
|
|
|
|
|
|
|
public:
|
2020-01-29 18:56:49 +01:00
|
|
|
DataSourceCameraConic(HardwareSerial* ser, int baud);
|
2019-11-18 17:15:32 +01:00
|
|
|
void test() override;
|
2019-11-18 18:11:26 +01:00
|
|
|
void readSensor() override;
|
|
|
|
int getValueAtk(bool);
|
|
|
|
int getValueDef(bool);
|
2020-01-20 18:43:51 +01:00
|
|
|
|
2020-01-26 20:13:31 +01:00
|
|
|
int yAngle, bAngle, yAngleFix, bAngleFix, yDist, bDist;
|
|
|
|
|
2020-01-20 18:43:51 +01:00
|
|
|
int count = 0, unkn_counter;
|
2020-01-31 13:35:40 +01:00
|
|
|
int xb, yb, xy, yy, true_xb, true_xy, true_yb, true_yy, calc_xb, calc_yb, calc_xy, calc_yy;
|
2020-01-20 18:43:51 +01:00
|
|
|
bool data_received = false, start = false, end = false;
|
|
|
|
|
2020-01-27 17:05:39 +01:00
|
|
|
int goalOrientation, pAtk, pDef;
|
2020-01-22 16:55:55 +01:00
|
|
|
int value;
|
2019-11-18 17:15:32 +01:00
|
|
|
};
|