View Full Version : PBASIC to SPIN Bridge
12-09-2009, 07:38 AM
Hello to all!
Background:·· I have about 4 years experiance with the bs2. I have about 6 months experiance with the bs2SX. I have quite a················
·················· few programs·written·for these two·stamps.·Many of my programs would benefit from the propeller's multi cog multi-tasking abilities!
Foreground:·· I have purchased, received, and started on the propeller education kit.
My Intention: To convert my BS2·projects to work with the propeller.
My Question: Are there any charts, lists or other documents that bridge the gap between PBASIC commands and SPIN
···················commands? IE ...makes the spin lanuage intrepretable by somebody familiar with Pbasic.
Spin is already close to PBASIC. The most notable difference that you will probably run into is the lack of hardware commands (SEROUT, DEBUG, PULSIN, etc.) but those are simply rectified by calling the appropriate object (serial.str, etc.). Secondly, the lack of GOTO might change the flow of your code. Other than that, though, the two languages are very similar.
Powered by enthusiasm
12-09-2009, 08:11 AM
Specifically, run the BS2 Functional replacement for the BS2 subroutines and the Extended Full Duplex Serial object for rs-232 communications. These subroutine objects have been thoroughly tested. Then try the FemtoBasic program to tie things together.
12-09-2009, 08:57 AM
Thanks for the responses. I have already used the FullDuplexSerialPlus. Works great. I guess what I'm having trouble with right now is the conversion of the COUNT command. In One program I am counting cycles on a pin then storing that count to a variable then taking that variable and making a desision with an IF THEN statement.
I will keep going through the Labs, any help with these conversions will surely speed the learning process.
12-09-2009, 09:37 AM
Please try to include the complete source listing of ALL of your source modules. You are among friends here and we all have gone through the learning process - even the gurus had to write their first program. Don't be embarrased to ask for help. Including the FULL source is the quickest way to get over the hurdles involved in starting out. Then, you will be able ask fewer questions and the helpful answers will come flooding in.
Don't be obstinate and force us to drag it out of you - then it will cease being fun and educational for all of us http://forums.parallax.com/images/smilies/yeah.gif
Post Edited (Mike Huselton) : 12/9/2009 2:43:30 AM GMT
12-09-2009, 09:46 AM
Mike that's a great Idea. I will post a copy of my file in PBASIC and then what I have so far in SPIN. Might be tomarrow. I would like to try a little bit more on the spin side, I have barely started on that, (and most of it has been guess work and pulling parts out of other programs from the lab manual that I don't know really what they do!)
Thanks for the help, I really do appriciate everybody's time.
12-12-2009, 10:54 AM
Do you know the BS2 object?
It provides a lot of BS2- commands as function calls:
It contains also a COUNT function.