SPQR-Team1-2020/include/systems/lines/linesys_2019.h

41 lines
883 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"
#define S1I A14
#define S1O A15
#define S2I A16
#define S2O A17
#define S3I A20
#define S3O A0
#define S4I A1
#define S4O A2
#define LINE_THRESH 90
2020-03-02 18:48:29 +01:00
#define EXTIME 200
2020-01-13 17:07:26 +01:00
#define LINES_EXIT_SPD 350
2019-12-26 17:44:58 +01:00
class LineSys2019 : public LineSystem{
public:
2019-12-26 17:44:58 +01:00
LineSys2019();
LineSys2019(vector<DataSource*> in_, vector<DataSource*> out);
2019-12-26 17:44:58 +01:00
void update() override;
void test() override;
void outOfBounds();
private:
vector<DataSource*> in, out;
DataSource* ds;
bool fboundsX, fboundsY, fboundsOX, fboundsOY, slow;
2020-01-13 17:07:26 +01:00
int inV, outV, linesensOldX, linesensOldY, value, linetriggerI[4], linetriggerO[4], i;
elapsedMillis exitTimer;
2020-01-15 13:55:51 +01:00
int outDir, outVel;
byte linesens;
};