re:pub

Dependents:   200_yotsuba_21 200_yotuba_21_uiChange

sensorGen.h

Committer:
THtakahiro702286
Date:
2021-03-06
Revision:
8:e11be46f5480
Parent:
6:fc6e4c814d3f

File content as of revision 8:e11be46f5480:

#ifndef SENSORGEN_H
#define SENSORGEN_H

#include "camera.h"
#include "line.h"
#include "jy901.h"
#include "main.h"
#include "IRsensor.h"
 
#define CAMCENTERX 165
#define CAMCENTERY 115

class sensorgen
{
public :
    sensorgen();
       
    void sensorloop();
       
//    float jy901();
       
//    float hcsr04();
       
//    float camera();
    
    int   line[6];
    float angle;
    float angleLimit;
    float ballAngle;
    float ballRange;
    bool  ballKeep;
    float blueAngle;
    float blueRange;
    float yellowAngle;
    float yellowRange;
    bool  ballSig, blueSig, yellowSig;
//private:
    Thread thread;
    Line   *_line[6];
    Cam    camera;
    JY901  jy;
    Timer  ballTimeout;
    Timer  blueTimeout;
    IRsensor       ir;
    Timer  yellowTimeout;
    DigitalIn b0;
    DigitalIn test,team,start;
    bool   ballTimeoutState,blueTimeoutState,yellowTimeoutState;
    int    angleCount;
    int    ballx,bally,bluex,bluey,yellowx,yellowy;
    float  tempAngle,rawAngle,irVal;
    int    ballkeepcount,ballcount,yellowcount,bluecount;
//    bool   b[4],b1[4],flag[4];
};

#endif