Shop OBEX P1 Docs P2 Docs Learn Events
QuickStart POV ? — Parallax Forums

QuickStart POV ?

cavelambcavelamb Posts: 720
edited 2012-08-08 14:27 in Propeller 1
POV, or Persistence of Vision.

Quick and dirty demo using the QuickStart LED string...
About an hour to design and code.

It worked well enough to read numbers in the big bathroom mirror
just moving it by hand. Timing matters, of course.
How fast you move determines how much of the string you may see.

But it really does (almost!) work.
I never could see the entire string in one pass.
But I saw 2 3 4 or 5 6 7 several times.
Even saw an 8 once!

The trick is to lock your eyes straight ahead and NOT FOLLOW the board.
If you follow the motion all you see is the single stack of lights...
DIGITS09.PNG

Some weights - if anybody is bored enough to follow up with a motorized version.

QuickStart board 18.9 grams
AA battery pack (with switch) 122.7 g.
9 volt transistor radio battery 46.0 g
It would also need a hall effect transistor to index the starting position.

I run with a 4 cell AA pack connected to exp pins 39/40, so that end of the board
would be "up" for the display to read right-side-up. USB connector down.

Dorothy hid the duct tape when I started measuring the ceiling fan blades. :innocent:

CON
{ Propeller Propeller display for the QuickStart board }    
  _CLKMODE=XTAL2 
  _xinfreq = 5_000_000
  ColTime = 10
 
VAR
  LONG MS001
 
PUB SetUp
  MS001 := CLKFREQ / 1_000        ' define 1 millisec 
 
  outa[ 16..23 ] := $00           ' %00000000  for LED string
  dira[ 16..23 ] := $FF           ' %11111111      
 
  Repeat 
    D0
    Kern
    D1
    Kern
    D2
    Kern
    D3
    Kern
    D4
    Kern
    D5
    Kern
    D6
    Kern
    D7
    Kern
    D8
    Kern
    D9
    Kern
    WaitMS(500)             ' wait a sec before serving again
 
 
PUB D0
  outa [16..23] := 127
  WaitMS(ColTime)
  outa [16..23] :=  65
  WaitMS(ColTime)
  outa [16..23] :=  65
  WaitMS(ColTime)
  outa [16..23] := 127
  WaitMS(ColTime)
 
PUB D1
  outa [16..23] := 127
  WaitMS(ColTime)
 
PUB D2
  outa [16..23] := 121
  WaitMS(ColTime)
  outa [16..23] :=  73
  WaitMS(ColTime)
  outa [16..23] :=  73
  WaitMS(ColTime)
  outa [16..23] :=  79
  WaitMS(ColTime)
 
PUB D3
  outa [16..23] :=  65
  WaitMS(ColTime)
  outa [16..23] :=  73
  WaitMS(ColTime)
  outa [16..23] :=  73
  WaitMS(ColTime)
  outa [16..23] := 127
  WaitMS(ColTime)
 
PUB D4
  outa [16..23] :=  15
  WaitMS(ColTime)
  outa [16..23] :=   8
  WaitMS(ColTime)
  outa [16..23] :=   8
  WaitMS(ColTime)
  outa [16..23] := 127
  WaitMS(ColTime)
 
PUB D5
  outa [16..23] :=  79
  WaitMS(ColTime)
  outa [16..23] :=  73
  WaitMS(ColTime)
  outa [16..23] :=  73
  WaitMS(ColTime)
  outa [16..23] := 121
  WaitMS(ColTime)
 
PUB D6
  outa [16..23] := 127
  WaitMS(ColTime)
  outa [16..23] :=  73
  WaitMS(ColTime)
  outa [16..23] :=  73
  WaitMS(ColTime)
  outa [16..23] := 121
  WaitMS(ColTime)
 
PUB D7
  outa [16..23] :=   1
  WaitMS(ColTime)
  outa [16..23] :=   1
  WaitMS(ColTime)
  outa [16..23] :=   1
  WaitMS(ColTime)
  outa [16..23] := 127
  WaitMS(ColTime)
 
PUB D8
  outa [16..23] := 127
  WaitMS(ColTime)
  outa [16..23] :=  73
  WaitMS(ColTime)
  outa [16..23] :=  73
  WaitMS(ColTime)
  outa [16..23] := 127
  WaitMS(ColTime)
 
PUB D9
  outa [16..23] :=  79
  WaitMS(ColTime)
  outa [16..23] :=  73
  WaitMS(ColTime)
  outa [16..23] :=  73
  WaitMS(ColTime)
  outa [16..23] := 127
  WaitMS(ColTime)
 
PUB Kern
  outa [16..23] :=   0  
  WaitMS(ColTime*2)
   
PUB WaitMS(W)                      'wait for W milliseconds
  WaitCNT (W*MS001+cnt)

640 x 424 - 50K

Comments

  • cavelambcavelamb Posts: 720
    edited 2012-08-02 10:17
    This morning I dummied in the alphabet using this approach and came up with:
    program: 536 longs
    variable: 1 long.
    That's 25 longs over budget, so obviously that won't fly for a full blown spinner.

    I suppose it could be broken down so that one cog handles alpha, another handles
    numeric and special characters.
    Then the main cog could parse the message text and call whoever was needed.

    But it seems to me inelegant. There is probably a better way...
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-08-02 12:23
    im kind of intrested in uploading your code just to see this!

    you just poaered the quickstart with 4aas wired to a usb connector, then taped it to your celing fan? how bout a couple of pics?
  • cavelambcavelamb Posts: 720
    edited 2012-08-02 13:55
    im kind of intrested in uploading your code just to see this!

    you just poaered the quickstart with 4aas wired to a usb connector, then taped it to your celing fan? how bout a couple of pics?


    Yes and no.

    Yes, I usually power the QS from 4 cell AA pack. But it doesn't attach to the USB connector.
    Instead it connects to the expansion connector via pins 39 and 40.
    See the other thread about powering the QuickStart board)

    But a long USB cable / powered hub might be pressed into service for a quick peek.

    But no, I didn't get to tape it to the ceiling fan (yet).
    (Dorothy hid the duct tape! She's as bad as my Mom used to be!)

    And... there are some real issues to solve first.

    Balance...
    The AA pack weighs 122.7 grams.
    The QuickStart board weighs 18.9.
    My ceiling fans have about 8" centers that can't be used.
    That puts the battery pack 8" from center.
    8" x 122.7 grams = 9816 moments (in gram-inches, of all things)
    9616 moments / 18.9 grams = 52.9 inches to balance.
    But my fan blades are only 25 inches long.
    So no way that combination will balance!.

    So, going the other way...
    Putting the QS board at 24" from center yields 453.6 moments.
    9 volt battery weighed 46.0 grams (without connector).
    453.6 / 46 = 9.8 inches from center for the 9v.
    That's a lot more workable.

    So next trip into Radio Shack I'll grab a 9v connector and give it a try.

    There are a lot o minor details to overcome to build a real POV display though.
    This was just a play-with-it-and-see-if-it-might-work test.

    Like timing (who knows how fast the fan turns, or how fast the characters should be "printed"?),
    And a start index (don't have one, so the numbers will probably move until the timing is right.).
    A start pulse is the way to go. Hall effect transistor and a strong magnet would do that nicely.

    HOWEVER!
    It's a cheap experiment.
    It cost you nothing to load the program and wave it by hand.
    (Except maybe feeling silly at first?)

    My best results were standing in front of the mirror, staring myself in the eyes and
    moving the board far left to far right.

    Don't look at the lights!
    Just let it sweep across your field of view.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-08-02 17:43
    Lol I just uploaded it real quick and waved my hand as fast as I could it kinda worked :). What I think would be complicated about the timing is its going to change the closer you but the board to the center of whatever is spinning i.e. fan, whell, motor,whatever.
  • cavelambcavelamb Posts: 720
    edited 2012-08-08 09:22
    Lol I just uploaded it real quick and waved my hand as fast as I could it kinda worked :). What I think would be complicated about the timing is its going to change the closer you but the board to the center of whatever is spinning i.e. fan, whell, motor,whatever.

    Yeah, it was a mess trying to get the timing anywhere in the ball park.
    And without an index, the display wanders around the circle at random.
    Then there is the problem of photographing something in motion - without
    the flash stopping it.
    None the less, with a little tweaking (both software and fan speed) we did
    finally see some numbers. Believe it or not, that's 8 and 9, and a 2.

    I haven't dug into it yet, but this seems like a perfect application for an
    infra red remote control! Just press up or doen to change the timing?!?

    DSCF4321a.JPG


    DSCF4318a.JPG
    640 x 480 - 41K
    640 x 480 - 39K
  • RaymanRayman Posts: 14,826
    edited 2012-08-08 10:37
    I like this project, looks like fun...
    Maybe you can add something to detect the g-force change and automatically sync...

    I've seem some Chineese toy that did this using a piezo disk...
    Could use an accelerometer...
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-08-08 10:51
    Neat project! For waving it back and forth by hand, an onboard accelerometer could provide the timing synchronization.

    -Phil
  • cavelambcavelamb Posts: 720
    edited 2012-08-08 14:27
    Actually, the hardest part, by hand or by fan, is trying not to chase the lights with your eyes.

    I think all the "propeller" displays I've read about use a magnet for indexing.
    And they know haw fast the thing in\s spinning, so they can actually calculate the
    timing parameters and get it really exact.

    I kinda like the accelerometer idea for hand waived. Then it could key off of the
    acceleration to start writing.

    But the best setup would be if one of our board layout gurus took an interest and
    laid out a propeller based propeller board. Long skinny arm with 16 to 24 leds
    on one end and the prop and stuff on the other for counter balance. Use a slip ring/
    armature to provide power to the board...
    A Hall effect (magnetic sensor) transistor to index and an IR transistor for an IR
    remote control.

    I was just playing around with this because it's been 107+ outside and I've been
    bored outta my mind...
Sign In or Register to comment.