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

RemovedSources/Camera.h.txt

Committer:
hazheng
Date:
2017-03-14
Revision:
36:7e747e19f660
Parent:
Hardwares/Camera.h@ 27:c68f711e5b67

File content as of revision 36:7e747e19f660:

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

#include "OV7725RegBuf.h"

#define CAMERA_PIXEL_WIDTH  160
#define CAMERA_PIXEL_HEIGHT 120
#define PICTURE_ARRAY_SIZE ((CAMERA_PIXEL_WIDTH / 8) * CAMERA_PIXEL_HEIGHT)

namespace SW
{
    class Core;
}

class Camera
{
public:

    Camera(SW::Core & core);

    ~Camera();
    
    void Update(float deltaTime);
    
    bool HasPicture() const;
    
    const unsigned char * GetPicture() const;
    
    void StartReceivingPic();
    
    void StopReceivingPic();
    
private:
    
    Camera();
    
    SW::Core & m_core;
    
    InterruptIn m_pClock;
    
    InterruptIn m_href;
    
    InterruptIn m_vsnyc;
    
    OV7725RegBuf * m_regBuf;
    
    float m_debugOutputTimer;
};