Colin Stearns / Mbed 2 deprecated qcControl

Dependencies:   mbed

Fork of dgps by Colin Stearns

handle/handleCamera.h

Committer:
krobertson
Date:
2014-04-22
Revision:
20:81d5655fecc2
Parent:
15:e3e03a9df89e

File content as of revision 20:81d5655fecc2:

#ifndef _TAKEIMAGE_H_
#define _TAKEIMAGE_H_

#include "adapt/usb.h"
#include "adapt/xbee.h"
#include "adapt/camera.h"
#include "packet.h"
#include <algorithm>
#include "dataLocation.h"
class ImageHandle{
private:
    Camera cam;
    bool initialized;
    Serial& outputDevice;
    
    /// \brief Setup the camera.
    void setup();
    /// \brief Take an image and send it over USB
    void take();
    /// \brief Check if an image must be taken
    bool check();

public:

    /// \brief Constructor
    ImageHandle():initialized(false),outputDevice(USB::getSerial()){}
    /// \brief Run an instance of this
    void run();
    
    static ImageHandle* hand;
    static ImageHandle& getImageHand(){
        if(hand == NULL){
            hand = new ImageHandle();
        }
        return *hand;
    }
};

#endif