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-04-20
Revision:
100:ffbeefc9e218
Parent:
36:7e747e19f660

File content as of revision 100:ffbeefc9e218:

#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;
};