QQQ / QQQCAM

Dependents:   qqq_izu_main_test

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers QQQCAM.h Source File

QQQCAM.h

00001 #ifndef QQQCAM_H
00002 #define QQQCAM_H
00003 
00004 /*
00005 Raspberry Piに接続したカメラは毎秒1回撮影を行い,画像の赤い部分の割合を"$CAM,d.ddd\r\n"のフォーマットで送信する.
00006 このライブラリは,シリアル受信割り込みを利用して内部のパラメータを更新する.
00007 
00008 #include "mbed.h"
00009 #include "QQQCAM.h"
00010 
00011 Serial pc(USBTX, USBRX, 115200);
00012 Serial cam_serial(p28, p27, 115200);
00013 
00014 QQQCAM cam(cam_serial);
00015 
00016 int main()
00017 {
00018     while(1) {
00019         pc.printf("rate:%.3f\r\n", cam.get_rate());
00020     }
00021 }
00022 */
00023 class QQQCAM{
00024 private:
00025     Serial *_serial;
00026     char rx_buf[256];
00027     int index;
00028     int flag;
00029     float rate;
00030     
00031 public:
00032     QQQCAM(Serial &cam);
00033     
00034 private:
00035     void receive();
00036 
00037 public:
00038     float get_rate();
00039 };
00040 
00041 #endif