The S2 LED Dot Matrix Printer Thread
Basic Concept: The idea is to use an unmodified S2, the GUI Program Maker, and long exposure photography to "print" messages with the S2's LEDs in Dot Matrix format. This should be a fun and impressive project for new learners in robotics (requiring some good problem solving skills - without having to do it all). The design should easily transfer to the new S3.
History: This all began over on the Nikos' Fibonacci Spiral Challenge Thread. Scribbling with the Pen Port and Chalk led to scribbling with LEDs and capturing the images with long exposure photographs. The first posts were here and here by Carol Lynn Hazlett.
Work continued with other ideas - use of the stock LEDs, spirographic scribbling, etc. All of these are recorded on the Nikos' Fibonacci Spiral Challenge Thread.
S2 LED Dot Matrix Printer: At some point, I got the idea of using the stock LEDs to "print" in a Dot Matrix format. Since there are three (not including the "power" LED, I knew it would take two passes. Because the S2 has excellent encoders I figured a carefully configured turn at the end of a line - along with a return trip to the starting point could achieve this.
Using a stock (or unmodified) S2 and the GUI Program Maker (no Spin required) would be ideal for beginners.
Details follow...
History: This all began over on the Nikos' Fibonacci Spiral Challenge Thread. Scribbling with the Pen Port and Chalk led to scribbling with LEDs and capturing the images with long exposure photographs. The first posts were here and here by Carol Lynn Hazlett.
Work continued with other ideas - use of the stock LEDs, spirographic scribbling, etc. All of these are recorded on the Nikos' Fibonacci Spiral Challenge Thread.
S2 LED Dot Matrix Printer: At some point, I got the idea of using the stock LEDs to "print" in a Dot Matrix format. Since there are three (not including the "power" LED, I knew it would take two passes. Because the S2 has excellent encoders I figured a carefully configured turn at the end of a line - along with a return trip to the starting point could achieve this.
Using a stock (or unmodified) S2 and the GUI Program Maker (no Spin required) would be ideal for beginners.
Details follow...
Comments
Note: My Dot Matrix Letters are 5 dots high and 4 dots wide (in this example). So, Pass One uses two LEDs and Pass Two uses all three.
Hint: Placing the S2 on a piece of paper at the End of Pass One, then use a Sharpie in the Pen Port to make a mark. Then placing the S2 on the same paper in just the right vertical and horizontal alignment position of the LEDs for the start of Pass Two and again use a Sharpie in the Pen Port to make a mark - This gives you a template to help program the turn with the GUI.
The GUI Code for the Dot Matrix Turn is attached.
The GUI program for "HELLO!" uses subroutines for each "condition" of the LEDs.
The Main Program is on the far left under the green gear. The subroutines (Yellow through Cyan) are on the right.
We begin with a 2 second pause, followed by the "Charge!" sound, and another 2 second pause. The allows the S2 to be turned on (or the reset button to be pressed). The photographer can then move into place to operate the shutter (since this is all in the dark), the "Charge!" sound helps you to know when to press the shutter (more on the photography set-up later).
All the LEDs are set to off - the S2 moves one "step" forward at motor speeds 50/50 - the S2 pauses and the "printing" begins by calling the correct subroutines (for turning on LEDs) in sequence.
Notice that each subroutine, turns on/off the LEDs (per condition) for 0.25 (or a quarter) of a second - turns all the LEDs off - the S2 advances a "step forward at motor speeds 50/50 - the S2 pauses - and the program returns to Main for the next instruction or subroutine call.
The top two dots of the vertical left leg of the "H" are lit (ochre subroutine), followed by two open columns (cyan subroutine), then the top two dots of the vertical right leg of the "H" are lit, and then two columns (cyan subroutine again) are left open for the "space" between the "H" and the "E."
At the end of line the line, the turn is made. In this photo - we see Pass One (left to right) of the "!" followed by a pause, the turn, a pause, and then Pass Two (right to left) for the bottom of the "!"
The program ends by pausing one second, playing the "Tada!" sound, and stopping the S2's movement and the Program. The final "Tada!" sound signals the photographer that the shutter can be released ending the time-lapse photo.
Maybe that Zuta printer will work after all.
I created these with Paint.net (freeware), but Paint can also be used. I just cut and paste them together to create new word and message diagrams or "maps." These maps really help when writing the message code in the GUI. You can check off each portion of each letter as you go (including spaces), Pass One, followed by the turn, and then do the same for Pass Two.
Finally - note that some letters work better in a 5 High X 5 Wide format (Plus) - See "W" and "W" alt for example. Also the X in PARALLAX is in this wide format. That "map" is also attached.
Update: More Characters added below.
Here is a photo of how I set things up to take the photos (long exposure) of the "printing." I have the camera on a tripod mount laying on a board sitting on two chairs. The camera is focused on the S2 below. Be sure to include the full run - Pass One and Pass Two in the frame. The bathroom mats are at the bases of doors to keep out external light. By the way - when I am doing this whole process, it drives my family nuts!
The camera (Canon Digital) is set in the bulb setting (f20, IS0 100) - that means that the shutter is open as long as the shutter release is pressed. My exposures are in the minute to a minute and a half range.
Here also is a time lapse video of what the S2 looks like (with the lights on) stepping along, printing with the LEDs, making the turn and returning to the start. Note the black tape covering the programming port (to stop light bleed) and the blue "power" LED. This is the only "modification" to the S2!
Note: Forum member xanadu suggested a way of "stitching" together individual photos using software - here is his quote from another thread - "There is another option, you can combine the pics post process using something like this. - Startrails.exe http://www.startrails.de/html/software.html" Facebook folk can see some amazing images created with this software here.
I have not tried this yet, but it might allow the use of less expensive cameras and maybe even a phone camera. There is probably such an app. Any ideas?
Can't wait to try this on the Green S3!
Ken, I highly recommend that you double or triple whatever you are paying Whit for his fine continuing work.
The latest base version of GUI code (including the End of Line turn, but not Pass One subroutines or Pass Two subroutines is attached. Simply insert the correct subroutine sequence for each Pass and save replacing the Generic "NAME" with your message name.
Code is called S2 LED Dot Matrix Printer 3.0 NAME - Remember this code is just the base - It is incomplete - also notice how the subroutines are lightened if they have not been called. This provides a good check once you've modified the base.
Attached are the GUI Program Maker Code for S2 LED Dot Matrix Printer 3.0 Beanie, the "Map" or Diagram (with S2 Pass Icon and Subroutine Symbols for each column of each pass.
When you look at the GUI Program Maker Code, you will notice that is the S2 LED Dot Matrix Printer 3.0 NAME modified with the subroutines as indicated in the "Map" - first is Pass One, the the Turn, and then Pass Two. Note also that repeated steps are done in loops (per number of times) and that "spaces" are in the main line of code (LEDs set Off Off Off, and "step" forward, and a pause.
Enjoy!
I discovered the best way to do this is using the photo process itself! Essentially the GUI code attached gives a tone for start (less cumbersome over repeated trials than Charge!) - Turns on all LEDS (On, On, On), drives ahead at motor speed 50/50 for 3 seconds - Stops and turns LEDs to (Off, Off, On - so you can see the turn) - makes the turn (lots of trial and error refinement here) - Stops and turns LEDs to (On, On, On) - drives ahead a motor speed 50/50 for 3 seconds - turns LEDs to (Off, Off, Off) - Stops and plays and End tone (again, simplified from Tada!)
By repeating the process of adjustment, photo, adjustment, photo - you can dial in the row and column alignment. Code, best photo and some misaligned photos attached.
Using only the GUI provides some limitations (of course), but keeps the the project accessible for true beginners!
Don't think this is going unnoticed. I have been following for that last week with much interest.
Keep up the great work!
All the code so far is based on my original idea. To "print", the Main Program of the GUI would call a subroutine (see Yellow example below). In the subroutine, the S2 fully stopped - would flash its LEDs in one of the various conditions for 0.25 of a second, turn the LEDs off, advance a fixed increment or step - and stop again - awaiting the Main Program to call the next subroutine. This resulted in multiple stops and starts and L O N G exposures for the photograph of the results (one to two minutes).
Yesterday, I began using a "New Method." To "print" the Main Program gets the S2 moving forward at a slow speed (30/30). As it rolls, it calls subroutines, the flash on and off the LEDs for 0.1 seconds - one subroutine after another. This results in the S2 continuously moving except before and after the turn for a slight pause (I may try to eliminate this pause too. Exposures now are MUCH shorter. See Yellow example of the new subroutine below.
Getting the movement speed and LED flash duration (On, Off) right keeps the LED flashes from being dashes rather than dots. See below.
The Propeller Beanie 3.0 using the Old Method took about 1 minute 20 seconds to run and photograph.
The similar Beanie v4 using the New Method took about 12 seconds to run and photgraph - it also a bit easier (clearer to program) - see next post for code.
Nikos - this continuous movement printing will be much better suited to the sort of sky-writing that could be done with the ELEV-8!
Subroutine Symbols (Y - Yellow, O - Ochre, R - Red, M - Magenta, V - Violet, B - Blue, and C - Cyan - Use S for spaces or all LEDs off) are inserted on the Propeller Beanie Map for ease of writing the GUI code. I made a chart for this, but cannot get it to upload!
Remember this is for students!
The "Base Version" of the S2 LED Dot Matrix Printer 4.0 New Method NAME is attached below - use this code to start - insert your subroutine calls for Pass One and Pass Two in the locations shown in the diagram below per a Message Map you create. Finally, substitute your Message "NAME" in the NAME spot when you save your new code (Example: S2 LED Dot Matrix Printer 4.0 New Method Beanie)
Slight tweaking of the turn code may be required for your particular S2 or message!
One last note - One of the great things about Phil Pilgrims GUI Program Maker is that Subroutines not used will be shown in a lightened color format (See the Beanie Code in the post above for example). This is gives a good visual clue whether you've used the correct Subroutines needed for your Message.