Shop OBEX P1 Docs P2 Docs Learn Events
tutorial on Scribbler 2 (S2) programming using Propeller C — Parallax Forums

tutorial on Scribbler 2 (S2) programming using Propeller C

RuturajRuturaj Posts: 19
edited 2014-09-01 15:13 in General Discussion
Hello guys,

This is my first post.
I am Computer science master's student with a little knowledge of hardware. I am using S2 for learning robotics.

So, I tried looking for the tutorial but couldn't find any, so I just started using Proprller C's tutorials and ended up here with no output

http://learn.parallax.com/propeller-c-simple-circuits/blink-light

So I thought about changing 26 to something else, so I just used variable i and kept incrementing it
Atleast I got movement on S2 (wheels were spining sometimes) :P

Please guide me to either find proper Propeller tutorial which will work on S2 or just guide me about tweaks and changes I have to make to use given propeller tutorials for S2.

Regards
Ruturaj

Comments

  • Ken GraceyKen Gracey Posts: 7,392
    edited 2014-08-25 21:53
    Ruturaj,

    Welcome to the forums - the S2 is a great choice for a first robot. With all sensors being properly configured and tested, you can eliminate wiring errors as one of your problems.

    The S2 is mostly programmed from the S2 Graphical User Interface. Go to the product page http://www.parallax.com/product/28136 and click on "downloads and documentation". Download the first two links on this page.

    We don't have much in the way of C programming support for the S2 though it's certainly possible. It might be more productive and rewarding to review the S2 code in Spin/ASM that's generated by the GUI. You can view the code within the GUI.

    Ken Gracey
  • RuturajRuturaj Posts: 19
    edited 2014-08-25 22:24
    Thank you Ken for such a fast and helpful reply
    I guess I will use spin/ASM for now, and try programming in C, again later after getting some insight.
  • RuturajRuturaj Posts: 19
    edited 2014-08-26 19:49
    Ken Gracey wrote: »
    Ruturaj,

    Welcome to the forums - the S2 is a great choice for a first robot. With all sensors being properly configured and tested, you can eliminate wiring errors as one of your problems.

    The S2 is mostly programmed from the S2 Graphical User Interface. Go to the product page http://www.parallax.com/product/28136 and click on "downloads and documentation". Download the first two links on this page.

    We don't have much in the way of C programming support for the S2 though it's certainly possible. It might be more productive and rewarding to review the S2 code in Spin/ASM that's generated by the GUI. You can view the code within the GUI.

    Ken Gracey

    @Ken Gracey

    I have downloaded both packages, and installed them. But I don't want to code using GUI, drag and drop, also how can I view genreted code in spin?
    Also how can upload code in spin in future if I write one.

    Regards
    Ruturaj
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-08-26 20:11
    Ruturaj,

    It's helpful to learn how to control the motors and sensors of the S2 by first making a simple GUI program and then click the "View the Propeller Program" icon (white arrow with lined paper (with red vertical line)). This will open up the Propeller Tool and you can see the Spin file produced from the GUI program. IMO, this is a very useful tool. You can then see how the various methods in in the S2.spin object are called.

    I like to use the GUI to generate sounds to be produced by the S2.

    Here's a thread about one of my experiments with the S2.

    Spin is pretty easy if you have experience in C. You need to keep in mind the "=" is an assignment when on the right of a group of symbols. To compare greater than or equal to, you use "=>" and less than or equal is "=<". If the equal sign is last (on the right), it becomes an assignment operation.
  • RuturajRuturaj Posts: 19
    edited 2014-08-26 20:38
    Duane Degn wrote: »
    Ruturaj,

    It's helpful to learn how to control the motors and sensors of the S2 by first making a simple GUI program and then click the "View the Propeller Program" icon (white arrow with lined paper (with red vertical line)). This will open up the Propeller Tool and you can see the Spin file produced from the GUI program. IMO, this is a very useful tool. You can then see how the various methods in in the S2.spin object are called.

    I like to use the GUI to generate sounds to be produced by the S2.

    Here's a thread about one of my experiments with the S2.

    Spin is pretty easy if you have experience in C. You need to keep in mind the "=" is an assignment when on the right of a group of symbols. To compare greater than or equal to, you use "=>" and less than or equal is "=<". If the equal sign is last (on the right), it becomes an assignment operation.

    Thank you very much Duane
    I will use GUI for now and have look at code produced in spin
    thanks for letting me know about "View the Propeller Program" icon
    and in future I can (have to) use Propeller tool to code in spin, right?
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-08-26 20:55
    Ruturaj wrote: »
    in future I can (have to) use Propeller tool to code in spin, right?

    You can use any of the Propeller programming tools to program the S2. There's Brad's Spin Tool (BST) which works great but is no longer supported by its creator (Brad). There's also Simple IDE which can be used with C and Spin. There's another programming tool I haven't used and I don't recall its name.

    The Propeller Tool which is part of the S2 GUI isn't the latest version (IIRC it's version 2.6) and it doesn't include the help files available in the full version of the Propeller Tool. The Propeller Tool included with the S2 software is mainly to allow you to see the Spin code. I don't think Propeller Tool included with the S2 GUI was intended to be used as a primary programming tool. You'll probably want to install the latest version of the Propeller Tool is you plan to program in Spin.
  • GenetixGenetix Posts: 1,754
    edited 2014-08-27 00:58
    Ruturaj wrote: »
    Thank you very much Duane
    I will use GUI for now and have look at code produced in spin
    thanks for letting me know about "View the Propeller Program" icon
    and in future I can (have to) use Propeller tool to code in spin, right?

    Ruturaj, if you want to learn Spin then read the Propeller Manual and Andy Lindsay's excellent Propeller Education Kit textbook.
    http://www.parallax.com/downloads/propeller-manual
    http://www.parallax.com/downloads/propeller-education-kit-labs-fundamentals-text
    You might also want to consider the 2 bottom books.
    http://www.parallax.com/catalog/books

    Here is the code for Andy's text but you might need to modify it for the S2 hardware. The pins are "hard-coded" so every line needs to be changed. (Learn CON declarations)
    http://www.parallax.com/downloads/propeller-education-kit-labs-fundamentals-example-code

    If there is something that don't understand or are not sure about then just ask.
  • RuturajRuturaj Posts: 19
    edited 2014-09-01 15:13
    Duane Degn wrote: »
    You can use any of the Propeller programming tools to program the S2. There's Brad's Spin Tool (BST) which works great but is no longer supported by its creator (Brad). There's also Simple IDE which can be used with C and Spin. There's another programming tool I haven't used and I don't recall its name.

    The Propeller Tool which is part of the S2 GUI isn't the latest version (IIRC it's version 2.6) and it doesn't include the help files available in the full version of the Propeller Tool. The Propeller Tool included with the S2 software is mainly to allow you to see the Spin code. I don't think Propeller Tool included with the S2 GUI was intended to be used as a primary programming tool. You'll probably want to install the latest version of the Propeller Tool is you plan to program in Spin.

    Thanks for the suggestions.
    I am using propeller tool to program in spin, so far it's good. Tried light following and obstacle avoidance.

    Genetix wrote: »
    Ruturaj, if you want to learn Spin then read the Propeller Manual and Andy Lindsay's excellent Propeller Education Kit textbook.
    http://www.parallax.com/downloads/propeller-manual
    http://www.parallax.com/downloads/propeller-education-kit-labs-fundamentals-text
    You might also want to consider the 2 bottom books.
    http://www.parallax.com/catalog/books

    Here is the code for Andy's text but you might need to modify it for the S2 hardware. The pins are "hard-coded" so every line needs to be changed. (Learn CON declarations)
    http://www.parallax.com/downloads/propeller-education-kit-labs-fundamentals-example-code

    If there is something that don't understand or are not sure about then just ask.

    Thank you for reply
    I have downloaded the pdf's and reading them, I won't be able to afford books for now, I haven't looked at Andy's text, with what will it help me?

    also This was also of help
    http://www.parallax.com/s2help/english/s2_doc.html
Sign In or Register to comment.