Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: KL25Z_camera_tester.cpp
- Revision:
- 1:b6aff788273c
- Parent:
- 0:27cd9d448187
--- a/KL25Z_camera_tester.cpp Sun Oct 09 12:17:17 2016 +0000
+++ b/KL25Z_camera_tester.cpp Mon Oct 10 10:59:55 2016 +0000
@@ -10,6 +10,10 @@
uint32_t i,t = 0;
uint32_t width = 0;
+ char curr_line[129];
+
+ /* Ensure string is null terminated */
+ curr_line[128] = 0;
printf("Starting camera test program\n");
@@ -37,31 +41,16 @@
//If the pixel value exceeds our threshold, print a 1
if (TFC_LineScanImage0[i] > CAM_THRESHOLD)
{
- printf("1");
+ curr_line[i] = '1';
width++; //Increment the width value
}
//Else, print a 0
else
{
- printf("0");
- }
- //printf("%d,",TFC_LineScanImage0[i]);
-
- if(i==127) //If we're at the end of array
- {
- if (TFC_LineScanImage0[i] > CAM_THRESHOLD)
- {
- printf("1\n");
- width++;
- }
- else
- {
- printf("0\n");
- }
-
- //printf("%d\r\n",TFC_LineScanImage0[i]);
+ curr_line[i] = '0';
}
}
+ printf("%s\n",curr_line);
printf("Width: %d\n", width);
width = 0;