高木のpixy2

Dependents:   00_yotsuba 10_motor-test 00_yotsuba 200_yotsuba_21

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers camera.h Source File

camera.h

00001 #ifndef CAMERA_H
00002 #define CAMERA_H
00003 
00004 #include "mbed.h"
00005 #include "lpf.h"
00006 
00007 class Cam
00008 {
00009 public:
00010     Cam(PinName mosi_sda_tx, PinName miso_scl_rx, PinName sclk);
00011     void SPIloop();
00012     
00013     uint16_t ballX();
00014     uint16_t ballY();
00015     uint16_t ballWidth();
00016     uint16_t ballHeight();
00017     
00018     uint16_t blueX();
00019     uint16_t blueY();
00020     uint16_t blueWidth();
00021     uint16_t blueHeight();
00022     
00023     uint16_t yellowX();
00024     uint16_t yellowY();
00025     uint16_t yellowWidth();
00026     uint16_t yellowHeight();
00027     
00028     uint16_t getData(int i);
00029 //    uint16_t rawBallCenterX();
00030 //    uint16_t rawBallCenterY();
00031 //    uint16_t rawBallWidth();
00032 //    uint16_t rawBallHeight();
00033 //    uint16_t rawBlueCenterX();
00034 //    uint16_t rawBlueCenterY();
00035 //    uint16_t rawBlueWidth();
00036 //    uint16_t rawBlueHeight();
00037 //    uint16_t rawYellowCenterX();
00038 //    uint16_t rawYellowCenterY();
00039 //    uint16_t rawYellowWidth();
00040 //    uint16_t rawYellowHeight();
00041     
00042     bool ballSignal();
00043     bool blueSignal();
00044     bool yellowSignal();
00045      
00046     uint8_t pixydata[14+42];
00047 private:
00048     SPI spi;
00049     Thread thread;
00050     uint8_t sendData[6];
00051     uint16_t data[24];
00052     uint16_t ballData[7];
00053     uint16_t blueData[7];
00054     uint16_t yellowData[7];
00055     bool ballSig,blueSig,yellowSig;
00056     lpf *ball[4],*blue[4],*yellow[4];
00057 };
00058 #endif