Scribble Your Name with the S2

Skill Level: Intermediate

Hours to Complete: 1-2

Skills Required: Spin programming, basic geometry

 

 

Time to brush off those geometry skills because you’re going to learn how to draw your own name using the S2 Robot, some graph paper, and the s2.spin object written by Phil Pilgrim!

Included in this object are two methods: move_to(x, y) and arc_to(x, y, radius). As the variables x, y and radius suggest, these methods move the S2 Robot to a pre-defined coordinate location, or arc by a certain radius to a specific coordinate location.

By plotting what we would like to draw on graph paper and calculating the radius of each of the arcs in our drawing, we should be able to plot out the coordinates we want our S2 to move to, and then easily transfer those ordered pairs into code, right?

Right! Let’s get started!

 

Starting with Spin:

This tutorial does assume that you have some familiarity with programming in Spin. If you never have before, or need a refresher, it would be a good idea check out one of these great beginner tutorials before continuing:

  • Propeller Education Kit Labs – Written by Andy Lindsay, these labs are a great introduction to the Propeller microcontroller. Previous electronics and programming experience is required.
  • Programming & Customizing the Multicore Propeller Microcontroller: Official Guide (#32316) – This book published by McGraw-Hill contains an introduction to the Propeller chip’s architecture and Spin programming language from Parallax’s Jeff Martin, as well as debugging techniques, and sensor interfacing by Andy Lindsay.
  • Propeller: First Steps (offsite) - Written by Gadget Gangster, these tutorials are meant for first-time Propeller programmers and are a great starting point, even if you’ve never programmed before!

 

What You’ll Need:

  • S2 Robot
  • Graph paper
  • Poster board
  • Large Sharpie Marker
  • s2.spin object (see below)

Click to download the S2.spin object zip file