SmartWheels self-driving race car. Designed for NXP Cup. Uses FRDM-KL25Z, area-scan camera, and simple image processing to detect and navigate any NXP spec track.

Dependencies:   TSI USBDevice mbed-dev

Fork of SmartWheels by haofan Zheng

Hardwares/Camera.h

Committer:
hazheng
Date:
2017-02-21
Revision:
25:6f63053cee81
Parent:
13:7dcb1642ef99
Child:
26:5814404856e2

File content as of revision 25:6f63053cee81:

#pragma once
#include "mbed.h"
#include <vector>

#include "OV7725RegBuf.h"

#define CAM_MAX_ROW 480
#define CAM_MAX_COL 640

namespace SW
{
    class Core;
}

class Camera
{
public:

    Camera(SW::Core & core);

    ~Camera();
    
    bool HasPicture() const;
    
    const unsigned char * GetPicture() const;
    
private:
    
    Camera();
    
    SW::Core & m_core;
    
    InterruptIn m_pClock;
    
    InterruptIn m_href;
    
    InterruptIn m_vsnyc;
    
    //unsigned char  m_pics[2][(CAM_MAX_ROW + 1) * (CAM_MAX_COL + 1)];
    
    unsigned char m_currentIndex;
    
    unsigned int m_currentRow;
    
    unsigned int m_currentCol;
    
    bool m_hasPic;
    
    OV7725RegBuf * m_regBuf;
};