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-STM32F103C8T6 mbed
Fork of Wii_IRCam_Test by
Revision 1:150525e9c21f, committed 2010-12-31
- Comitter:
- shimniok
- Date:
- Fri Dec 31 09:33:30 2010 +0000
- Parent:
- 0:cf1bc7c313b4
- Child:
- 2:2b68d1d14aca
- Commit message:
- Updated text output and connect speed to work with Java GUI
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Dec 30 07:50:11 2010 +0000
+++ b/main.cpp Fri Dec 31 09:33:30 2010 +0000
@@ -6,6 +6,10 @@
// obviously mbed is 3.3v so no level translation is needed
// using built in i2c on pins 9/10
//
+// PC GUI client here: http://code.google.com/p/wii-cam-blobtrack/
+//
+// Interfacing details here: http://www.bot-thoughts.com/2010/12/connecting-mbed-to-wiimote-ir-camera.html
+//
DigitalOut myled(LED1);
PwmOut servo(p21);
@@ -39,7 +43,6 @@
{
// Init IR Camera sensor
i2c_write2(addr, 0x30, 0x01);
- pc.printf("+\n");
i2c_write2(addr, 0x30, 0x08);
i2c_write2(addr, 0x06, 0x90);
i2c_write2(addr, 0x08, 0xC0);
@@ -59,11 +62,11 @@
// PC serial output
pc.baud(115200);
- pc.printf("Initializing camera...");
+ //pc.printf("Initializing camera...");
cam_init();
- pc.printf("complete\n");
+ //pc.printf("complete\n");
// read I2C stuff
while(1) {
@@ -100,10 +103,11 @@
Iy4 += (s & 0xC0) <<2;
// print the coordinate data
- pc.printf("Ix1: %4d, Iy1: %4d\n", Ix1, Iy1 );
- pc.printf("Ix2: %4d, Iy2: %4d\n", Ix2, Iy2 );
+ //pc.printf("Ix1: %4d, Iy1: %4d\n", Ix1, Iy1 );
+ //pc.printf("Ix2: %4d, Iy2: %4d\n", Ix2, Iy2 );
+ pc.printf("%d,%d,%d,%d,%d,%d,%d,%d\r\n", Ix1, Iy1, Ix2, Iy2, Ix3, Iy3, Ix4, Iy4);
- wait(0.250);
+ wait(0.050);
}
}
