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.cpp

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

File content as of revision 25:6f63053cee81:

#include "Camera.h"

#include "Core.h"
#include "OV7725RegAddr.h"
#include "PinAssignment.h"
#include "SWUSBServer.h"


DigitalOut testLED(LED_GREEN, 1);

void OnPixelClock()
{
    
}

void OnHorizontalRise()
{
    
}

void OnHorizontalFall()
{
    
}

void OnFrameClock()
{
    
    testLED = testLED.read() == 1 ? 0 : 1;
}

Camera::Camera(SW::Core & core) : 
    m_core(core),
    m_pClock(InterruptIn(PIN_CC_PCLOCK)),
    m_href(InterruptIn(PIN_CC_HREF)),
    m_vsnyc(InterruptIn(PIN_CC_VSYNC)),
    m_currentIndex(0),
    m_currentRow(0),
    m_currentCol(0),
    m_hasPic(false),
    m_regBuf(NULL)
{
    
}

Camera::~Camera()
{
    
}

bool Camera::HasPicture() const
{
    return m_hasPic;
}

const unsigned char * Camera::GetPicture() const
{
    return NULL; //m_pics[m_currentIndex == 0 ? 1 : 0];
}