Shop OBEX P1 Docs P2 Docs Learn Events
New to Spin — Parallax Forums

New to Spin

bboy8012bboy8012 Posts: 153
edited 2007-12-12 22:18 in Propeller 1
I just recieved my propeller, and have read and completed all the labs, and journyed into the propeller manual as well. My questions are what language would this most resemble? I am a beginner in java and VC++. I am just looking for more tutorials, so I can start coding for more robotic types of projects. Also can anyone steer me on say how to convert this BS2 code into spin? All help is greatly appreciated, and thanks in advance!·
(Calibrate:
       DEBUG "Arming ESC...", CR
       DEBUG "Applying full brake", CR
          FOR counter = 1 TO 150
              PULSOUT ESCpin, 1000
              PAUSE 20
          NEXT
         PAUSE 50
       DEBUG "Applying full Throttle",CR
          FOR counter = 1 TO 150
              PULSOUT ESCpin, 2200
              PAUSE 20
          NEXT
        PAUSE 50
       DEBUG "Applying full brake", CR
          FOR counter = 1 TO 150
              PULSOUT ESCpin, 1000
              PAUSE 20
          NEXT
         PAUSE 50
       DEBUG "ESC READY!!", CR
       RETURN)

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-12-12 04:50
    Since you're using some BS2 statements that have no direct equivalent in Spin, you should download the BS2 Function Library from the Propeller Object Exchange and look at the included demo program and the comments in the BS2_Functions source itself which describe the various routines. There are routines to do the DEBUG, PULSOUT and PAUSE statements. If you have any questions after looking at those, feel free to chime in with them.
  • bboy8012bboy8012 Posts: 153
    edited 2007-12-12 21:31
    What objects would show me how to control a servo, just the basics, and only one so I can see how it is in Spin, I want to get away from basic, and just do strictly spin and assembly.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-12-12 21:41
    Servo32 (from the Object Exchange) is an appropriate object for servo control.· There is another servo control object in the Object Exchange that provides for automatic ramping of servo position or speed, but handles fewer servos and is mostly (all?) written in Spin.

    The reason for suggesting the BS2_Functions object was that it provides a lot of the functionality of PBasic, but is written in Spin as method calls.· Have a look through it.
  • bboy8012bboy8012 Posts: 153
    edited 2007-12-12 22:18
    Ohhh Thanks Mike
Sign In or Register to comment.