BS2 to BS2px
Humanoido
Posts: 5,770
How to convert the timing code from BS2 to BS2px
in the attached programs?
References
IR Remote for the Boe-Bot Book, Appendix B, page 177, BS2 to BS2 IR Messages
www.parallax.com/Store/Books/EducationalTexts/tabid/181/CategoryID/66/List/0/Level/a/ProductID/149/Default.aspx?SortField=ProductName%2cProductName
IR Remote for the Boe-Bot Book v1.1 (.pdf)
www.parallax.com/Portals/0/Downloads/docs/prod/sic/WebIR-%20v1.1.pdf
IR Remote Book Source Code (.zip)
www.parallax.com/Portals/0/Downloads/src/prod/IRRemoteCode-v1.1.zip
in the attached programs?
References
IR Remote for the Boe-Bot Book, Appendix B, page 177, BS2 to BS2 IR Messages
www.parallax.com/Store/Books/EducationalTexts/tabid/181/CategoryID/66/List/0/Level/a/ProductID/149/Default.aspx?SortField=ProductName%2cProductName
IR Remote for the Boe-Bot Book v1.1 (.pdf)
www.parallax.com/Portals/0/Downloads/docs/prod/sic/WebIR-%20v1.1.pdf
IR Remote Book Source Code (.zip)
www.parallax.com/Portals/0/Downloads/src/prod/IRRemoteCode-v1.1.zip
Comments
using the recommended two Basic Stamp 2 boards
and a bench power supply to avoid any battery low problems.
To my surprise, it did not work. The receiver continues to show "Pulse
out of range, trying again..."
Since the same message appears each time the transmitting stamp is reset,
it looks like pulses are sent to the receiver. But the characters do not
appear on the screen.
I used a new IR LED from a Boe-Bot kit, and the IR Receiver included with
the Book "IR Remote for the Boe-Bot" and checked wiring several times.
Any idea why the original application is not working?
Post Edited (humanoido) : 5/9/2009 12:53:25 PM GMT
- use conditional compilation to set up constants for converting RCTIME, PULSIN, PULSOUT parameters to microseconds (us) -- personally, I think this is best as it brings clarity. Then you'll need to do a tiny bit of work converting the "magic number" RCTIME/PULSIN material in the IR texts to us (for example if a SIRCS IR start is 1.2ms, that's 1200 us).
- check your Pbasic manual and calculate the ratio to convert (and use) the magic numbers:
BS2px = .75us units
BS2 = 2 us units
2/.75 = 2.66
I don't have the IR text in front of me, but I think it was values like 300 for .6ms, etc. So you'd multiply 300 * 2.66 to get equivalent RCTIME units for the BS2px. Method one is really better because then your code will be utterly portable, e.g.
As to why the orig. programs are not working on BS2s -- can you post actual code?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
This part makes no sense, however. But I would still think you'd get a good character on the RX side.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
but it does not work. Does anyone have two BS2 boards to
test the software?
Post Edited (humanoido) : 5/11/2009 10:04:10 AM GMT
education forum that explains how to convert from BS2
to BS2px. This will be very helpful, after I can show the
code runs with two Basic Stamp 2 boards.
Here's the link where this fine tutorial by Andy Lindsay, of
Parallax, is located.
http://forums.parallax.com/showthread.php?p=769250
the BS2 boards and circuits worked fine with the code.
Post Edited (humanoido) : 5/12/2009 12:54:15 PM GMT
StartMax CON 1700
StartMin CON 1300
Bin1Max CON 1200
Bin1Min CON 800
Bin0Max CON 700
Bin0Min CON 300
help and did testing.) This was the final vital information needed to
make the code work successfully. Thanks to Mike Green, vrossi, SRLM,
Zoot, and Sticky. Also thanks to Andy Lindsay for the original Stamp 2
code and book, "IR Remote for the Boe-Bot." This project moves into the
next phase, developing a universal infrared communications transceiver
for robots in motion.
I added Andy Lindsay's code from the "IR Remote for the Boe-Bot" to my robot, and thanks to this thread successfully converted it to a BS2P. I can read the codes from a Sony remote and make the robot do things accordingly. I want to have different "modes" and "tasks". At the most ordinary level, there's a manual mode, where the robot just responds to button presses and moves in the required direction, says something, etc., etc.. It all worked fine, until I added my autonomous roaming code in the mix. Then I noticed that the bot is not looping through it's sensor reading routines. My goal is to make the robot do its thing (mainly check different sensors and act according to program) but also once in a while check for button presses from the remote. For that, I use a check like your IrDetPin = 1 and send the program to a routine like your Get_IR_Byte_Message. If no new button press is detected, the robot should continue roaming and focusing or reading sensors.
While debugging, I just noticed that my program gets stuck in the "LOOP UNTIL irPulse < StartMax AND irPulse > StartMin" loop (I'm making reference to your code for clarity, my code is adapted from below). What is happening is that the IR sensor detects an IR signal, sends the program to the code checking routine, which waits for the signal to be proper (a Sony start code, in my case), but that is not happening, so it loops.
What do you think is the most elegant and effective way to get out of the loop, yet not lose IR sensitivity - In other words, I can probably make a timed loop, like "check for the start pulse for such amount of time then get out if you don't see it", but I'm trying not to waste time with waits and pauses?
Thanks.
PS. This is the basic code that's the inspiration for getting the button press (I got rid of the BS2 part and adapted to my variables and such). It's from a Parallax doc "Infrared Remote AppKit (#29122)" - It's the "Wait for start pulse..." part that I get stuck in...
Post Edited (modemman) : 5/27/2009 2:53:41 PM GMT