PDA

View Full Version : Roboeye and Basic stamp 2



coors
02-23-2005, 06:39 AM
I am using the Roboeye Camera connected to the Basic Stamp 2e with the BOE.· What· I am trying to do is have·the·roboeye camera·turn on and capture the image when a signal is sent to it by the micorcontroller.· I have the controller already sending a signal to an LED on the BOE.· I have the roboeye connected to P15 on the BOE.· I have verified that data is going through to the roboeye by using a counter program .· However I need the roboeye to be activated(turned on) and capture images for 15 seconds when the·roboeye receives·a signal and then discontinue.

Any help would be appreciated

MacGeek117
02-23-2005, 10:13 AM
Please post your code.
bugg

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Geordi: "It's like the laws of physics went right out the window!"
Q: "And why shouldn't they, there so inconvinient!"

Geordi LaForge, Chief Engineer, USS Enterprise, NCC 1701-D
Q, Omnipotent Prankster

coors
02-26-2005, 02:11 AM
All I need is the code on how to power the camera. Meaning how to control the power going to pin 15 which is where the robeye is connected to. And then some code to actually save the captured image.

coors
02-26-2005, 02:20 AM
I mean P15 by VDD (top part of Basic stamp 2e black casing)

coors
02-26-2005, 02:48 AM
Here·I will run not too sure

serout 15, recommended timing ?? (power the roboeye to start caputure imageing)
camera starts capturing image for a set amount of time.

Sends image back to pc (which already does through robeye software)then somehow ( not too sure ) save it to a file.
Any help on this...kinda frustrated http://forums.parallax.com/images/smilies/jumpin.gif
Thanks

coors
02-26-2005, 03:01 AM
Sorry about all the posts but this is what I finally come to

The roboeye will always be powered just need code on to somehow start the auto capture for certain time..then stop it the capture after the time passes..then save that to a file.

coors
02-26-2005, 04:41 AM
Here is some sample code

' -----[ Title ]--------------------------------------------------------------


' {$STAMP BS2e} ' Stamp directive
' {$PBASIC 2.5} ' PBASIC directive

' -----[ Variables ]----------------------------------------------------------


camera VAR Byte
time VAR Byte
' -----[ Main Routine ]-------------------------------------------------------

controlPanel:

SEROUT 15, 84, ["Engage Camera ?", CR]
SERIN 15, 84, [camera]
PAUSE 10

SEROUT 15, 84, ["Length of Camera Time", CR]
SERIN 15, 84, [DEC3 time]
PAUSE 10

IF camera = "Y" THEN Engage_Camera
IF camera = "N" THEN DisEngage_Camera

GOTO controlPanel

'-----------subroutines--------------------

Engage_Camera:
SEROUT 15, 84, ["Camera is Engaged", CR]

'engages capture mode in camera for 'time' entered


DisEngage_Camera:
SEROUT 15, 84, ["Camera is not engaged", CR]
' nothing is done


????Do not know what to add as code in the engage camera subroutine???
????Just want it to be in capture mode for a certain time
???

DWinchell
02-28-2005, 07:36 AM
Hi http://forums.parallax.com/images/smilies/smile.gif

I have been looking at your RoboEye Project requirements. After
Rereading the RoboEye manual 10 times and experimenting all
Afternoon I can’t get the BOE to issue commands to the RoboEye
Camera board. It looks like the BOE can send data to the PC
Terminal and the PC Terminal can send data to the BOE thru the
RoboEye Camera board only. I tried the following code:

FOR counter = 1 TO 5

SEROUT 14, 84,["echo", CR, LF ]

SEROUT 14, 84,[BIN4 $1B, BIN4$54, BIN4 $20, BIN4 $0D]

SEROUT 14, 84,["Counter = ", DEC counter, CR, LF ]

DEBUG "Counter = ", DEC counter, CR

PAUSE 1000

NEXT

Typing ECHO
Then
Typing #27T 20#13 at the PC terminal will make the

Will make the picture scan once.

I will keep looking at this as I have a need to make this happen also.

Thank You
Dave Winchell

Jens Altenburg
02-28-2005, 06:33 PM
Hi,

I read the thread. As I understand you want to start a picture transmission from RoboEye to PC, isn't it?
Please have a look at the following program snippet. A simple main loop starts a picture transmission periodically, using the "T" command. The speicial T comand code is in the subroutine SUB_ComT.
Note that the routine·shows also the different styles of serial data (with or without ESC·character). I think for your needs the first SEROUT wasn't neccessary.

Hope it would help

Jens


'{$STAMP· BS2}······· 'STAMP directive (specifies a BS2)
'{$PBASIC 2.5}
serStr· VAR···· Byte(5)···· ' reserve 5 byte
bCount· VAR···· Byte
Start:
··· serStr(0) = 27········· ' ESC
··· serStr(1) = "T"········ ' T - Command
··· serStr(2) = "2"
··· serStr(3) = "5"
··· serStr(4) = 13········· ' CR
··· bCount = 0
··· DEBUG CLS, "RoboEye - T-Command", cr
main:································· ' endless loop
··· GOSUB SUB_ComT
··· PAUSE 5000
··· GOTO main

' *****************
' *· T - Command· *
' *****************
' The first SEROUT sends data to the RoboEye terminal window on PC
' The data string has to be terminated by CR. All data go through
' RoboEye transparently
' The second SEROUT starts with an ESC character, that means the
' RoboEye expected a following comand. In the example ESC was followed
' by "T25" and is terminated by CR. In the result the picture transmisson
' starts for 25 times.
SUB_ComT:
··· DEBUG "#27T25#13", CR
··· SEROUT 15, 84, ["Pic = ", DEC bCount, CR] ' data to terminal
··· PAUSE 500································ ' wait until data will be sent
··· bCount = bCount + 1
··· SEROUT 15,84,[STR serStr\5]·············· ' starts picture transmission
··· RETURN

coors
03-03-2005, 01:51 AM
Thanks for the code it worked perfectly.· Just changed it a bit(Do loop).
Anyways what I am messing with now is the save option.· I was gonna try to save the entire video feed when it is transmitting but I believe this is not possible.· SO what I am trying to do is every time there is a picture transmission in the subroutine it automatically saves it in a folder.· So if the picture transmission is 5 times there will be 5 different picture captures saved.· Look at code for more detail onto where I am talking about.

'{$STAMP· BS2E}·······
'{$PBASIC 2.5}
serStr· VAR···· Byte(5)···· ' reserve 5 byte
bCount· VAR···· Byte
Start:
··· serStr(0) = 27········· ' ESC
··· serStr(1) = "T"········ ' T - Command
··· serStr(2) = "2"
··· serStr(3) = "5"
··· serStr(4) = 13········· ' CR
··· bCount = 0
··· 'DEBUG CLS, "RoboEye - T-Command", CR
· DO
··· GOSUB SUB_ComT
··· PAUSE 5000
'Here is where the function would come in to save it to a file ie. event1
'then would do the loop again and save the next transmission ie. event2
'continues until it breaks out of loop

·LOOP UNTIL bCount = 5
· END

SUB_ComT:
··· DEBUG "#27T25#13", CR
··· SEROUT 15, 84, ["Pic = ", DEC bCount, CR] ' data to terminal
··· PAUSE 500································ ' wait until data will be sent
··· bCount = bCount + 1
··· SEROUT 15,84,[STR serStr\5]·············· ' starts picture transmission
·RETURN

coors
03-04-2005, 05:49 AM
bump*

Jens Altenburg
03-04-2005, 05:33 PM
Hi,

nice to hear that the program works. Theoretically incomming picture data could be saved on PC. But that's not an easy work. The·USB unit is connected as a virtual com port, that means you can communicate with the USB board without the RoboEye PC application. In this case you have to write your own PC application.

To watch about the incomming picture data you need·a terminal program with 921000 Baud. Open the original RoboEye software, connect the USB·unit and check if your BS2 programm work. Than close the RoboEye software without pressing the disconnecting button. Now the USB board·stays·in receiving mode (the yellow LED has to be flashing during incomming data). If you now open the terminal program·with the virtual com port (on my PC it is COM5) the terminal shows·a lot of characters. Most of it are non printable, exept·the string "Pic = ", DEC bCount, CR].

I hope I made not to much confusion.

Jens

coors
03-09-2005, 05:25 AM
What I'm trying to do is look for a system command that will enable the save button on the roboeye software.· Just how you can click the button to capture image, now I'm doing that with the code.· I need something similar to do that with the save button.· Save that image to any file, same as just clicking the "save image to file" button.
Thanx

Jens Altenburg
03-09-2005, 02:07 PM
Hi Coors

I'm so sorry, but that function is not available at the moment. I'll ask the programmer of the PC application software if he could implement a command string that will start any· of the "button clicks" by a message into the terminal window.

Regards

Jens

supernewbie
03-10-2005, 07:38 AM
>nice to hear that the program works. Theoretically incomming
>picture data could be saved on PC. But that's not an easy work.
>The USB unit is connected as a virtual com port, that means you
>can communicate with the USB board without the RoboEye PC
>application. In this case you have to write your own PC application.

Jens and I guess the Parallax folks,

I'm interested in interfacing with the Roboeye mod through my own application. Given that it's all a serial interface the commands are relatively straightforward to emulate, but what format is the incoming picture data in? I couldn't find that in the documentation anywhere, but I've been known to miss things.

P.s. I'm a programmer so don't worry about throwing me off too much with the complexity of the software :)

Thanks

Mike

Jens Altenburg
03-10-2005, 02:26 PM
Hi Mike,

I'm in discussion with Ken how we could communicate technical parameters for programmes which want to made his own applícations.

I'll will report about the results in the next few days.

Jens

supernewbie
03-10-2005, 03:24 PM
Great, thanks

adri_vh
03-03-2006, 09:14 AM
**I'm in discussion with Ken how we could communicate technical parameters**
**for programmes which want to made his own applícations**


Hi Jens,

I know it's been a long time since this thread ended, but is there any update with regards to your statement above.

Thanks so much,
~Adri

Jens
03-08-2006, 09:11 PM
Adri,

I'll meet Ken ending of March. I hope we found a way for publish source and/or hardware of the RoboEye.

Best regards,

Jens