loading
 
Roborealm and Basic Stamp
Brian  [4 posts]
10 years
Trying the exercised described from TOM using a webcam and basic stamp to follow an object. I've created the VB code and loaded it into Roborealm and using the COG and RGBFilter module was able to get the output to change based on the position of a green plastic ball relative to the camera. The difficulty is the laptop I'm using has only two USB ports so one port is connected to the basic stamp using the parallax USB adapter. The other port is tied to a USB 4-port hub and that is what the camera is connected to. When I launch the basic stamp it is communicating through Com port 4. If I start the Serial module on roborealm and set the com setting to port 4 then try to start the module I get the message "can't connect to port". If I stop the basic stamp then restart the serial module then it connects. It is the same with the basic stamp. Which ever program is launched first the other can't connect to the com port. I've tried switching the com port on the serial module to com 3, but nothing happens when running the basic stamp. It appears that the Stamp only communicates through  com 4 but  I can't get the serial module to connect.
Any suggestions or help?
Thanks
Anonymous 10 years
Hi,

I assume by your statement "Which ever program is launched first" that you are running the Basic Stamp development kit AND RoboRealm at the same time on the laptop? If this is the case then your laptop is correct in denying access to the port for one of the programs. Both programs cannot connect to the serial port at the same time. You have to disconnect one in order to get the other to connect. This makes debugging on the Boe-Bot a little tricky but unfortunately the serial port is not a shared resource enforced by the OS.

You should be able to download the program to the BoeBot, stop the laptop Basic stamp editor, reset the Boe-Bot (to start the program) and then connect to it using RR.

Or do I misunderstand your setup?

STeven.
Anonymous 10 years
You got the setup correct. Unfortunately when I purchased the laptop, through the internet, I didn't notice that it lacked the 9-pin com port that I would normally use with the Basic Stamp.
So as long as the Basic Stamp editor is running, it is communication through the "Com" port. Turning off the editor frees up the port, but the Basic Stamp is still looking at the Com port for the Serial string? I'm just making sure I understand. That might explain why my Debug line wasn't working either. I added a debug line to report what it was seeing and all I got was blank screen.
Thanks for the suggestion. Can't wait to try it.

Brian
Brian  [4 posts] 10 years
I need some guidance on the Serial Module setup. I reduced the VB script to send out a simple signal to the "Left" and "Right" motors just to check the communications. I've set the "Com Port" settings on the module to match those on the Basic Stamp; 9600 baud, 8 bits, Parity-None, and Stop Bits 1.  I noticed on the code presented by TOm that he had the signal as "True" rather than "Inverted", but I didn't find any info on the module to tell which is required.
Also what do I need for an Initialization Sequence; or do I need one?  Presently my Send Sequence is \[LEFT_MOTOR]\[RIGHT_MOTOR], is this correct.
As always THANK YOU for your help.

Brian
Anonymous 10 years
When you mention the True versus Inverted what are you referring to? The Serial module in RR, the VBScript module, the Boe-Bot BS2 code??

No ... it your code on the BoeBot does not require any initial params then you don't need to worry about any initialization sequence.

Yes, the format you have seems correct. Note that the '\\' will send a binary 4 byte number over the serial connection. A single '\' will send a single 1 byte (8 bit) number. You'll have to ensure that you receive that amount in the BS2 code otherwise the protocol sequence will get out of order.

STeven.
Anonymous 10 years
The Basic Stamp code, presented, had in the SERIN line, after the COM Port Indentifier, the number 84, which establishes the com specs. According the Basic Stamp manual the setting 84 has the signal True vs Inverted. I wondered if that is a spec that corresponds with the Roborealm Serial Module.

Thanks
Brian
Anonymous 10 years
Yes the 84 has to do with the com port specs:

8 bit, no parity, 9600 baud

To see how this number is generated have a look at

http://parallax.com/dl/docs/cols/nv/vol1/col/nv16.pdf

which is a great document for SERIN and SEROUT questions.

You would naturally need to configure the Serial module towards those parameters in order for communication to work.

STeven.
Anonymous 10 years
STeven,
I was able to get the communications corrected I think. The Stamp is "driving" to HB-25 motor controllers. Experimentation showed that a pulse signal of 1875 the motor is stopped. Below that figure the motor rotates one direction, above it rotates in the other direction.  I have a green ball on the end of a dowel stick. Presently when I move the ball in front of the camera, no matter where in distance the ball is I never can get a position such that I cross the 1875 threshold to change directions. I believe my multipliers that are applied to the values obtained from COG module need to be adjusted. It appears I have to adjust for the differences between a BS2 and a BS2P.

Brian
Anonymous 10 years
Brian,

very cool and thanks for the note about BS2 and BS2P. Will come in handy for future projects.

Any chance of a youtube appearance of your project?

:-)

STeven.
Brian  [4 posts] 10 years
Steven,
As soon as I get the bot up and running correctly I'll try to get some video on YouTube.

Thanks again for all your help. I know I will be picking brains as I get further into my goals.

Thanks
Brian

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index