Shop OBEX P1 Docs P2 Docs Learn Events
PBASIC to SPIN Bridge — Parallax Forums

PBASIC to SPIN Bridge

electromanjelectromanj Posts: 270
edited 2009-12-12 03:54 in Propeller 1
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.

·

Comments

  • SRLMSRLM Posts: 5,045
    edited 2009-12-09 00:53
    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
  • Mike HuseltonMike Huselton Posts: 746
    edited 2009-12-09 01:11
    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.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    JMH
  • electromanjelectromanj Posts: 270
    edited 2009-12-09 01:57
    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.
  • Mike HuseltonMike Huselton Posts: 746
    edited 2009-12-09 02:37
    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 yeah.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    JMH

    Post Edited (Mike Huselton) : 12/9/2009 2:43:30 AM GMT
  • electromanjelectromanj Posts: 270
    edited 2009-12-09 02:46
    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.
  • AribaAriba Posts: 2,690
    edited 2009-12-12 03:54
    Do you know the BS2 object?
    It provides a lot of BS2- commands as function calls:
    obex.parallax.com/objects/30/

    It contains also a COUNT function.

    Andy
Sign In or Register to comment.