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 Watchdog SDFileSystem DigoleSerialDisp
Camera.cpp
00001 #include "mbed.h" 00002 #include "Camera.h" 00003 00004 Camera::Camera(PinName tx, PinName rx): 00005 serial(tx, rx) 00006 { 00007 serial.baud(115200); 00008 00009 return; 00010 } 00011 00012 void Camera::start() 00013 { 00014 serial.attach(callback(this, &Camera::receive), Serial::RxIrq); 00015 00016 // ping 00017 // should now get ACK\r or NACK\r 00018 // send colormap here 00019 // should now get ACK\r or NACK\r 00020 // disable white balance 00021 // should now get ACK\r or NACK\r 00022 serial.printf("ET\r\n"); 00023 // should now get ACK\r or NACK\r 00024 return; 00025 } 00026 00027 00028 void Camera::receive() 00029 { 00030 while (serial.readable()) { 00031 char c = serial.getc(); 00032 fprintf(stdout, "%c\n", c); 00033 } 00034 return; 00035 } 00036 00037 00038 /* 00039 * (Byte 0: 0x0A – Indicating the start of a tracking packet 00040 * Byte 1: Number of trac k ed objects (0x00 – 0x08 are valid) 00041 * Byte 2: Color of object tracked in bounding box 1 00042 * Byte 3: X upper left corner of bounding box 1 00043 * Byte 4: Y upper left corner of bouding box 1 00044 * Byte 5: X lower right corner of boudning box 1 00045 * Byte 6: Y lower right corner of boudning box 1 00046 * Byte 7: Color object tracked in bound box 2 00047 * ... 00048 * Byte x: 0xFF (indicates the end of line, and will be sent after all tracking info 00049 * for the current frame has been sent) 00050 */ 00051 void Camera::parse(char c) 00052 { 00053 00054 return; 00055 } 00056
Generated on Tue Jul 12 2022 21:36:18 by
1.7.2