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: FRDM-TFC mbed CBuffer XBEE mbed_angular_speed motor2 MMA8451Q
Fork of KL25Z_Camera_Test by
Revision 0:566127ca8048, committed 2016-10-14
- Comitter:
- maximusismax
- Date:
- Fri Oct 14 10:56:56 2016 +0000
- Child:
- 1:a4883d9c75ec
- Commit message:
- Test
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FRDM-TFC.lib Fri Oct 14 10:56:56 2016 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/emh203/code/FRDM-TFC/#24430a0d7fd8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Oct 14 10:56:56 2016 +0000
@@ -0,0 +1,68 @@
+#include "mbed.h"
+#include "TFC.h"
+#define CAM_THRESHOLD 3000
+
+
+DigitalOut myled(LED1);
+
+int main() {
+ TFC_Init();
+
+ 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");
+
+ while(1) {
+ //If we have an image ready
+ if(TFC_LineScanImageReady>0)
+ {
+ //Reset image ready flag
+ TFC_LineScanImageReady=0;
+ printf("\r\n");
+ //printf("L:");
+
+ //Strange thing that cycles the battery indicator
+ //Leaving in as this is a good indicator that the camera test program is running
+ if(t==4)
+ t=0;
+ else
+ t++;
+ TFC_SetBatteryLED_Level(t);
+
+ for(i = 0; i < 128; i++) {
+ curr_line[i] = (int8_t)(TFC_LineScanImage0[i] >> 4) & 0xFF;
+ printf("%02x", curr_line[i]);
+ }
+ printf("\n");
+ //printf("0x%x\n", curr_line);
+ /*
+ //Loop through camera pixels
+ for(i=0;i<128;i++)
+ {
+ //If the pixel value exceeds our threshold, print a 1
+ if (TFC_LineScanImage0[i] > CAM_THRESHOLD)
+ {
+ curr_line[i] = '1';
+ width++; //Increment the width value
+ }
+ //Else, print a 0
+ else
+ {
+ curr_line[i] = '0';
+ }
+ }
+ printf("%s\n",curr_line);
+
+ printf("Width: %d\n", width);
+ width = 0;
+ */
+
+ }
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Oct 14 10:56:56 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/25aea2a3f4e3 \ No newline at end of file
