CMUCam Help Required!
G'day,
I got a nice, shiny new red box today, straight from Sparkfun, with a spankin' new CMUCam in it! The only problem is... I've no clue how to hook it up, and code it... I've looked for docs (and still am), but each one only seems to solve one bit of the problem, nothing really shows the entirety of the solution. Does anyone know where I can lay my hand on "wiring" docs, and coding docs? I'd also be appreciative if anyone has some sample code I could test...
Thanks
-John
I got a nice, shiny new red box today, straight from Sparkfun, with a spankin' new CMUCam in it! The only problem is... I've no clue how to hook it up, and code it... I've looked for docs (and still am), but each one only seems to solve one bit of the problem, nothing really shows the entirety of the solution. Does anyone know where I can lay my hand on "wiring" docs, and coding docs? I'd also be appreciative if anyone has some sample code I could test...
Thanks
-John

Comments
Did you look at this page here? http://cmucam.org/projects/cmucam4/wiki/SparkFun_Camera
That page has a link called "Board Layout and Port Information" among other things, looking at hat shows you the hookups.
http://cmucam.org/attachments/689/CMUcam4%20Arduino%20Shield%20DOC%20BL&P%20-%20v10.pdf
John mentioned in the top post, the camera was from SparkFun. Here's the link.
I'm pretty sure another version of the CMUcam is being made by Parallax. I don't know how long it will take Parallax to get them produced and up for sale. I'm personally waiting for the Parallax version since I don't like the "shield" form factor.
I've found out how to hook it up etc, and I am now writing the code. For simplicity sake I'm using the Prop, this is what I have so far...
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 CR = 13 OBJ Serial: "FullDuplexSerialPlus" Comp: "FullDuplexSerialPlus" VAR long recv PUB Start Comp.start(31, 30, 0, 9600) Comp.str(String("CMUCamv4 Driver", CR)) Comp.str(String("Author: John Board", CR)) Comp.str(String("(c) 2012 John Board", CR)) Comp.str(String("----------------------------",CR, CR)) Comp.str(String("Waiting for CMUCam to initalize...", CR)) waitcnt(clkfreq*5+cnt) Comp.str(String("Attempting to connect to CMUCam...", CR)) Serial.start(1, 0, 0, 19200) Comp.str(string("Serial Started.", CR)) waitcnt(clkfreq/1+cnt) Comp.str(string("Toggling LED.", CR)) ledOff Serial.rxStr(@recv) comp.str(string("Recieved: ")) comp.str(recv) repeat PUB Stop Serial.stop PUB ledOn sendCommand(String("L0", 13)) PUB ledOff sendCommand(String("L1", 13)) PUB getVersion sendCommand(String("GV", 13)) PUB resetSystem sendCommand(String("RS", 13)) PUB sleepDeeply sendCommand(String("SD", 13)) PUB sleepLightly sendCommand(String("SL", 13)) PUB sendCommand(Command) Serial.Str(Command) DAT {{ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ TERMS OF USE: MIT License │ ├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation │ │files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, │ │modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software│ │is furnished to do so, subject to the following conditions: │ │ │ │The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.│ │ │ │THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE │ │WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR │ │COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ }}Can anyone see any issues with it? It doesn't seem to be turning off the Red LED on the board.
Note: This code is very preliminary, I only started working on it like 1/2 hour ago...
As another note, I myself don't like the sheild formfactor either :P I would have waited for parallax to release their version, however I need something up and running ASAP.
Thanks,
John
I had been waiting for the Parallax version but apparently they aren't going to be making one. Kye just mentioned this.
Looks like I'll get the SparkFun version.
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 CR = 13 OBJ Serial: "FullDuplexSerialPlus" Comp: "FullDuplexSerialPlus" VAR long recv[100] PUB Start | directory Comp.start(31, 30, 0, 9600) 'Start serial with computer Serial.start(1, 0, 0, 19200) 'Start serial with camera Comp.str(String("CamTerm v1.0", CR)) serial.rxStr(@recv) serial.rxStr(@recv) 'Wait for camera to send it's name... (CMUCam4 v1.02) Comp.str(string("Camera Ready!", CR)) Comp.str(String("----------------------------",CR)) 'Terminal repeat comp.str(directory) comp.str(string("> ")) comp.rxStr(@recv) comp.tx(CR) serial.str(@recv) serial.str(string(" '\r'", CR)) repeat 'This makes the terminal only work for one command, but it dumps all the output of the camera serial.rxStr(@recv) comp.str(@recv) comp.tx(CR) DAT {{ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ TERMS OF USE: MIT License │ ├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation │ │files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, │ │modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software│ │is furnished to do so, subject to the following conditions: │ │ │ │The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.│ │ │ │THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE │ │WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR │ │COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ }}The terminal output:
It doesn't seem to finish the transmission before stopping... any ideas?
EDIT: With a bit of trickery I think I can get around this using a serial.rx instead of serial.rxStr.... Although any ideas on the above solution will be greatly appreciated
There could also be a problem with the "rxstr" limiting the size of a string.
At the moment I'm just improving my software and writing a small java GUI. I'll post when I have a nice usable library