Sends raw hex values from camera to hosted program

Dependencies:   FRDM-TFC mbed

main.cpp

Committer:
FatCookies
Date:
2016-11-11
Revision:
5:727d5bbc14a5
Parent:
4:968036e0940b
Child:
6:728c38a132ba

File content as of revision 5:727d5bbc14a5:

#include "mbed.h"
#include "TFC.h"
#define CAM_THRESHOLD 128
 
 
DigitalOut myled(LED1);
Serial pc(PTD3,PTD2);



 
int main() {
    TFC_Init();
    pc.baud(57600);
    
    uint32_t i = 0;
    while(1) {
        
        //If we have an image ready
        if(TFC_LineScanImageReady>0) {                   
            pc.putc('H');
            for(i = 0; i < 128; i++) {
                pc.putc((int8_t)(TFC_LineScanImage0[i] >> 4) & 0xFF);    
            }


            //Reset image ready flag
            TFC_LineScanImageReady=0;
            wait(0.05);
        }
    }
}