Anybody Know a good way to learn SPIN?

Hello, I am trying to learn SPIN, and need a better way to do so. My platform for my Prop is the Propeller BOE. Does anybody out there know a good technique?

Comments

  • 24 Comments sorted by Date Added Votes
  • Read the Propeller Manual that comes with the Propeller Tool (under Help). Look at the sample programs provided and try modifying them. But mainly, just start programming! You'll make a lot of mistakes, but that's how you learn. When you get stuck on something, post your questions in the Forum, and you'll get the help you need!

    -Phil
    “Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery
  • Have you tried the Learn pages designed for the BOE and SPIN?
    https://learn.parallax.com/tutorials/spin
    Specifically, are the "Get Started with the Propeller Board of Education" page:
    https://learn.parallax.com/tutorials/language/spin/get-started-propeller-board-education

    As a whole, it is hard to find the SPIN tutorials now. With the push for C and BlocklyProp, SPIN has taken a back seat in my opinion. I still program primarily in SPIN (as do many, many others) so I am sure there will be others that add more SPIN resources that I forgot about or didn't recall.

    When I learned SPIN, I simply loaded demo code from various accessory product pages, the OBEX, or the forums. From there I dug in to the code and began manipulating parts to understand the changes. After that, I went through the Propeller Education Kit and migrated projects to the BOE, Activity board, and even the Quickstart. The Propeller Education Kit PDF can be also pulled from the Propeller Tool software under the Help menu (along with the Propeller Manual for all things syntax!). In my opinion, the PE Kit book and the Propeller Manual is what taught 70% of what I know of the Propeller. The other 30% came straight from these forums and fellow forum users answering my questions.

    Other:
    Link to additional Propeller Documentation and app notes
    https://learn.parallax.com/educators/teach/spin-programming-multicore-propeller
    some links on this thread may be broken, but: https://forums.parallax.com/discussion/comment/1049896/#Comment_1049896



  • Thank you, by the way, WBA, I was just reading about your GeoCache project. Neat idea! I put a similar lock on my desk drawer but could not put any password or anything on it. I pulled on a cork attached to a string to open it.
  • Same way you get to Carnegie Hall: Practice, practice, practice.
    Re-inventing the wheel is not a waste of time if, when you are done, you understand why it is round.
    Cool, CA, USA 95614
  • Peter JakackiPeter Jakacki Posts: 6,902
    edited April 4 Vote Up0Vote Down
    I started when they had the Spin tutorial in the Prop manual. I would load it and make sure it ran, and then I would break it. Unlike my big sister's walking doll that I took apart when I was knee high to a grasshopper, you can break software over and over again (and it doesn't chase you around the house).

    My introduction to the Propeller was when they still had the Spin tutorial in the Prop manual. I would go through each exercise step by step, made sure it worked the way it was supposed to, and then I would "break" it by slowly modifying it until it didn't work anymore. Understanding what made it break was just as important as knowing what made it worked, because only then would I "understand" why it worked.

    Looking at those links to the Parallax site though it is sad to see that there are extensive tutorials for C, and then Blockly, and then PBASIC, and lastly Spin, as if they are ashamed of it. But Spin is very easy to learn and if you "break" something, the important thing is that is mostly the software, and not a complicated tool, so you know where to look. So the 3Ps of learning, that of Practice Practice Practice can in "practice" be practised in this manner :)
    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    Tachyon Forth News Blog
    TACHYON DEMONSTRATOR
    Brisbane, Australia
  • work through the prop ed manual, then think of something you would like to do/make and run with it. Feels more like fun than learning.
    Ordnung ist das halbe Leben
    I gave up on that half long ago.........
  • MIchael_MichalskiMIchael_Michalski Posts: 57
    edited April 5 Vote Up0Vote Down
    Just remember the "14 Ps" Particularly patient proactive practice positively predicates practically precise poly-processor Parallax Propeller programming paradigms. :-)
    Particularly patient proactive practice positively predicates practically precise poly-processor Parallax Propeller programming paradigms.

    .
  • Awesome, I like to point beginners to Dave Scanlan's 2006 tutorial thread that came about when the Propeller itself was new, and literally everyone was new to it.
    spin-code-examples-for-the-beginner-public-version
  • Thank you, Tracy, for that fantastic link to learning SPIN!
    I tried the very first example in Dave's thread and Propeller Tool and Propeller IDE did not like the following statement:
    DirA[noparse][[/noparse]Pin] := Out                 'Makes port A16 an output port
    
    with the following error message:
    Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2013 Parallax Inc. DBA Parallax Semiconductor.
    Version 1.00.70 Compiled on Mar 20 2014 11:35:10
    Compiling...
    I:/Users/Admin/PropIde Work/Blink_one.spin
    I:/Users/Admin/PropIde Work/Blink_one.spin(52:8) : error : Expected an expression term
    Line:
      DirA[noparse][[/noparse]Pin] := Out                 'Makes port A16 an output port
    Offending Item: noparse
    
    Removing all references to noparse allowed the program to compile and seemed to run as indicated - blinking an LED on A16 5 times.

    Can someone explain what noparse was supposed to do?
    Florida, between St. Petersburg and the Gulf of Mexico

    Do not look directly into laser with remaining good eye...
  • I think that’s the web browser adding control characters.
    San Mateo, CA
  • Yeah, look at the pdf version instead...
    Prop Info and Apps: http://www.rayslogic.com/
  • Thank you Jeff & Rayman, I will work from the PDF file instead of the inline listings.
    Florida, between St. Petersburg and the Gulf of Mexico

    Do not look directly into laser with remaining good eye...
  • The noparse was a way to get the old forum software to ignore certain characters to prevent SPIN code from getting eaten by the forums thinking they were text formatting commands. (like the single left bracket between the noparse commands in your example) When the forum was converted, some of the noparse HTML came over as text and inadvertently ended up corrupting the SPIN code in the new forum.
  • Clock LoopClock Loop Posts: 1,443
    edited April 5 Vote Up0Vote Down
    IF learning spin is a bit too intense for people, I suggest starting with a basic stamp 2. (BS2)


    Spin is kinda like a complex version of basic in my opinion.


    The biggest tool any new or old programmer has, is full page prints of every command possible with examples below the command description and syntax.


    Use one page per command to allow plenty of examples in the extra space(and on the back), laminate them, and use them like a deck of cards that you try to memorize(or can flip through real fast)
    (this is great in the classroom)

    This might be a good idea for a parallax product.. Command with syntax plus examples, laminated flip card deck sets for specific languages.


    Opening the pdf manual and pressing CTRL+F is also useful, but sometimes we don't know what or how to do, what we are doing and flipping through commands till you see something that might work... seems easier with a deck of cards...
    To study the nature of randomness in a digital processor network using the same clock source, 54 prop chips were all connected to a master prop. http://forums.parallax.com/discussion/127983/55-parallax-propeller-s-parallells-processing-of-permanent-perturbations/p1
    Optic communication between homogenous and commensurable, 8-core, 635nm emitting, phase locked loop, bit salad tossing units? http://forums.parallax.com/discussion/comment/1248240/#Comment_1248240
    TheBlackBox: Release v2.0 - Propeller HSS FX/Sequencer with Digital Audio SPDIF output. http://forums.parallax.com/discussion/115258/theblackbox-release-v2-0-propeller-hss-fx-sequencer-with-digital-audio-spdif
    E-Tools - Mono555 calculator, resistor calculator, voltage divider calculator, RCtime calculator, LM317 calculator, Binary-Hex-Decimal calculator, Resistor color matrix, Series LED resistance calculator, OHMS LAW calculator.
    http://forums.parallax.com/discussion/81449/e-tools-html-java-script-electronic-design-tools-free-for-you
  • JonnyMacJonnyMac Posts: 5,976
    edited April 5 Vote Up0Vote Down
    I don't find Spin complex at all -- in fact, it is simpler than BASIC in some ways. And, it's practical. I'm lucky in that I make a good chunk of my living designing Propeller-based products and coding them, and I always code in Spin. These are some of the things that I'm working on or have completed.

    -- industrial road sign controller and associated display controller (they communicate via RS-485 or XBee)
    -- professional laser tag controller
    -- multi-camera pan/tilt controller (uses XBee between base and camera platforms) -- pan/tilt platforms use LANC to control camera
    -- paratrooper jump trainer for US Army
    -- kiddie ride controller
    -- DEF CON 22 badge (with Parallax and Ryan Clarke who also used to work at Parallax)
    -- EFX-TEK AP-16+ Audio player (serial/DMX)
    -- EFX-TEK AP-8+ Audio player (serial)
    -- EFX-TEK FC-4+ Lighting controller (serial/DMX)
    -- EFX-TEK HC-8+ DC lighting controller (serial/DMX)
    -- EFX-TEK RC-4+ Relay controller (serial/DMX)
    -- DMX lighting controllers for multiple companies

    (Full disclosure: I'm one half of EFX-TEK)

    Those are the ones I can remember -- there has been a lot more over the past 10 years. And the HC-8+ is very general-purpose and gets used in a lot of applications. Lately the escape rooms industry is loving the HC-8+ and I write a lot of puzzle code for companies that build escape rooms and associated products.

    You can see some of the artistic work I've done with the Propeller -- again, programmed in Spin -- on this page:

    -- https://www.pinterest.com/jonmcphalen/techno-art/

    As with anything new it will take a little time to learn, but it's worth it. I find it allows me to adapt to my client needs very quickly. Those Hollywood projects are usually programmed under a lot of pressure with very little time.

    You can see more of my projects in the Customer Projects section.

    Go easy on yourself, and do try to give yourself a little time each day.
    Jon McPhalen
    Hollywood, CA
    It's Jon or JonnyMac -- please do not call me Jonny.
  • Again, thank you all. The "noparse" thing has cofused me since I started the Forums, no longer. JonnyMac, Rayman, others, thank you for the help with learning Spin. I am soon to begin with this.
  • Wish I could remember the joy of toggling my first LED... I think that was with a Basic Stamp. But, I think Jon is right that Spin is better...
    Prop Info and Apps: http://www.rayslogic.com/
  • I remember. It was so exciting!
  • Clock LoopClock Loop Posts: 1,443
    edited April 7 Vote Up0Vote Down
    Rayman wrote: »
    Wish I could remember the joy of toggling my first LED...



    And then one day you try using the led as a sensor.. and the joy starts all over again..

    (i created an entire project based on using the led as an emitter AND sensor)
    http://forums.parallax.com/discussion/comment/1248240/#Comment_1248240
    To study the nature of randomness in a digital processor network using the same clock source, 54 prop chips were all connected to a master prop. http://forums.parallax.com/discussion/127983/55-parallax-propeller-s-parallells-processing-of-permanent-perturbations/p1
    Optic communication between homogenous and commensurable, 8-core, 635nm emitting, phase locked loop, bit salad tossing units? http://forums.parallax.com/discussion/comment/1248240/#Comment_1248240
    TheBlackBox: Release v2.0 - Propeller HSS FX/Sequencer with Digital Audio SPDIF output. http://forums.parallax.com/discussion/115258/theblackbox-release-v2-0-propeller-hss-fx-sequencer-with-digital-audio-spdif
    E-Tools - Mono555 calculator, resistor calculator, voltage divider calculator, RCtime calculator, LM317 calculator, Binary-Hex-Decimal calculator, Resistor color matrix, Series LED resistance calculator, OHMS LAW calculator.
    http://forums.parallax.com/discussion/81449/e-tools-html-java-script-electronic-design-tools-free-for-you
  • Awesome! Does it Work?
  • Never mind, it so does. How did you use the LEDs as inputs?
  • Tracy AllenTracy Allen Posts: 6,197
    edited April 7 Vote Up0Vote Down
    There is a post about using an LED as a light meter in the tutorial thread that I linked to earlier. Specifically,
    https://forums.parallax.com/discussion/comment/574644/#Comment_574644
    That was one of my first projects on a Propeller. Satisfying, right behind flashing the LED. Read it and flash it in quick succession.
  • Alright, lets see if I can try it out.
Sign In or Register to comment.