Shop OBEX P1 Docs P2 Docs Learn Events
How use PBasic files as SPIN Objects? — Parallax Forums

How use PBasic files as SPIN Objects?

TylerSkylerTylerSkyler Posts: 72
edited 2011-12-26 23:46 in Propeller 1
Hello everyone, this is my first post on this forum and I fear I will probably make a fool of myself. So onto the question...I've came to Propeller from the "Basic Stamp side" and i am using some gps parsing code coded for the Basic Stamp. I would like to use this code with my propeller. Is it possible to use the PBasic file as an object like the Spin objects off of the obex? Could i call the GetLatitude Function in the PBasic file from Spin or is this functionality only possible with Spin or Assembly objects? All help, suggestions, and code would be greatly appreciated.

Thanks,
Tyler

Comments

  • JonnyMacJonnyMac Posts: 9,198
    edited 2011-12-26 22:38
    I have LOTS of BASIC Stamp experience (1994 to the present) so I know where you're coming from. Let me be plain: don't try to do what you're wanting to do. Learn to use the Propeller properly, don't handcuff it with older programming styles. Yes, it takes effort, but you're rewarded in the end. If you're a proficient Stamp programmer it won't take you more than a week or so to get the hang of the Propeller. It does take a different mindset, especially when it comes to running multiple cogs; still, it's worth the effort.

    Probably not what you wanted to hear, but I'm a firm believer in telling people the truth. Trust me, in the end, you'll be sorry if you try to crowbar Stamp code into the Propeller. What you need to do is understand what the code wants, learn the Propeller, then program the Propeller accordingly.

    And don't worry, there is a lot of ready-to-run GPS code available (I wrote some of it). You may need to modify it so that it suits you, but that's all part of the fun.
  • TylerSkylerTylerSkyler Posts: 72
    edited 2011-12-26 23:29
    Thanks for the speedy response. Not exactly what I wanted to hear :smile:...but alas I knew that would probably be the case. I'll work towards gps parsing in Spin. I have looked at some of the sample code and objects from others and it is intimidating to say the least.

    Wish me luck,
    Tyler
  • JonnyMacJonnyMac Posts: 9,198
    edited 2011-12-26 23:46
    You'd learn to drive before attempting the Indy 500, right? Same thing goes here. Learn to program the Propeller, then tackle specific tasks. As I stated, if you're already experienced the transition won't take long -- espeically if you don't try to crowbar the BS2 into the Propeller. Once you do get acclimated you will be very happy, I promise. In addition to dividing your programming task amongst subroutines (called methods in Spin), you can divide up the task between processors and that's where the real fun begins. And, of course, the idea of reusable objects beats the tar out of cutting-and-pasting between BS2 programs.
Sign In or Register to comment.