SPQR-Team-2019-REVAMPED/include/systems/lines/linesys_camera.h

41 lines
911 B
C
Raw Normal View History

#pragma once
2019-12-26 17:44:58 +01:00
#include <Arduino.h>
#include "behaviour_control/ds_ctrl.h"
#include "systems/systems.h"
#include "vars.h"
2021-05-13 08:38:20 +02:00
#define S1O A7
#define S1I A6
#define S2O A2
#define S2I A3
#define S3I A9
#define S3O A8
#define S4I A0
#define S4O A1
#define LINE_THRESH_CAM 325
#define EXIT_TIME 300
2020-03-02 18:48:29 +01:00
class LineSysCamera : public LineSystem{
public:
2020-03-02 18:48:29 +01:00
LineSysCamera();
LineSysCamera(vector<DataSource*> in_, vector<DataSource*> out);
2019-12-26 17:44:58 +01:00
void update() override;
void test() override;
void outOfBounds();
2020-03-02 18:48:29 +01:00
void checkLineSensors();
private:
vector<DataSource*> in, out;
DataSource* ds;
bool fboundsX, fboundsY, fboundsOX, fboundsOY, slow;
2020-03-02 18:48:29 +01:00
int inV, outV, linesensOldX, linesensOldY, value, linetriggerI[4], linetriggerO[4], linepins[4], i;
unsigned long exitTimer;
2020-01-15 13:55:51 +01:00
int outDir, outVel;
byte linesens;
};