just a test

Dependencies:   mbed

Fork of scoreLight_Advanced by Alvaro Cassinelli

simpleLaserRenderer.h

Committer:
mbedalvaro
Date:
2012-04-04
Revision:
4:f9d364f10335
Parent:
3:b44ff6de81bd
Child:
5:73cd58b58f95

File content as of revision 4:f9d364f10335:

#ifndef simpleLaserSensingRenderer_h
#define simpleLaserSensingRenderer_h

#include "blobConfig.h"
// Include hardware interface for display and sensing:
#include "hardwareIO.h"

//extern DigitalOut myled3; // for tests...

#define debugDelayMirrors // this is to check visually the mirror delay (but it is also beautiful)

#define RENDER_INTERVAL 0.0004 // good value in previous version (monaco) was 0.00011 // in seconds (Ticker)

#define WAIT_NORMAL 3 // waiting time for setting mirror position MINUS waiting laser time (note that this total waiting time may be equal to 0 if we set a good sampling freq for the renderer, but 
// and if the shape is regular so that this time does not change significatively - this is not the case for multiple blobs or highly deformed blobs). 
#define WAIT_LASER 1  // waiting time for activating the laser
#define WAIT_FIRST 5 // special waiting time for first point
#define WAIT_LAST 5  // special waiting time for last point

enum lsdStateType {NORMAL_POINT, LAST_POINT, MOVE_NEXT_BLOB, START_POINT};

class simpleLaserSensingRenderer {
public:

    void setConfigToRender(blobConfig*); 
    //void startRenderer(); // pb: I cannot use the ticker function inside the class!
    void laserRenderThread();
  //  void laserRenderThreadONEBLOBONLY();
   // void laserRender(blobConfig*);
    
    blobConfig* ptBlobCfToRender;
    
    lsdStateType stateLsd;
    int totalBlobs;
    int currentBlob;
    int currentPoint;
    int currentMirrorDelay;
    int currentTotalPoints;
    int currentColor;
    int x,y; // auxiliary variables storing mirror position(0-4096)
    
    int waitNormal, waitLaser, waitFirst, waitLast;
};

#endif