GDP 4
/
KL25Z_Camera_Test
Sends raw hex values from camera to hosted program
Diff: main.cpp
- Revision:
- 5:727d5bbc14a5
- Parent:
- 4:968036e0940b
- Child:
- 6:728c38a132ba
diff -r 968036e0940b -r 727d5bbc14a5 main.cpp --- a/main.cpp Fri Nov 11 12:13:10 2016 +0000 +++ b/main.cpp Fri Nov 11 12:16:50 2016 +0000 @@ -5,14 +5,9 @@ DigitalOut myled(LED1); Serial pc(PTD3,PTD2); -char curr_line[128]; + -uint8_t curr_left; -uint8_t curr_right; -uint8_t right; -uint8_t left; -uint8_t measured_value; int main() { TFC_Init(); @@ -23,32 +18,11 @@ //If we have an image ready if(TFC_LineScanImageReady>0) { - - left = 0; - right = 0; - for(i = 63; i > 0; i--) { - curr_left = (int8_t)(TFC_LineScanImage0[i] >> 4) & 0xFF; - if(curr_left < CAM_THRESHOLD) { - left = i; - break; - } - } - - for(i = 64; i < 128; i++) { - curr_right = (int8_t)(TFC_LineScanImage0[i] >> 4) & 0xFF; - if(curr_right < CAM_THRESHOLD) { - right = i; - break; - } - } - pc.putc('H'); for(i = 0; i < 128; i++) { pc.putc((int8_t)(TFC_LineScanImage0[i] >> 4) & 0xFF); } - - measured_value = (64 - ((left+right)/2))/64.f; - + //Reset image ready flag TFC_LineScanImageReady=0;