Larson Scanner, Anyone?
maybe has done 1 way, cannot find similar based on 'search'.
first, there lot of led back-and-forth, running lights jobs out there; many of them claiming "larson scanners". but "larson scanner" needs trail of dimmer lights following leading light. whether inventor such i'm not sure, when glen larson did these battlestar galactica (cylons) , knight rider (kitt), used light bulbs , bulbs' incandescence (their residual glow) made trailing effect.
leds go on/off rapidly, there's no continuing glow-down when go off, no gradual fade out.
so - how done leds?
whip out arduino? good start, still.
use pwm pins? there six.
charlieplex? stop already.
glom "library"? not me.
off-board circuitry, max-blah-blah? totally unnecessary.
i worked out 10 positions.
i didn't use pwm pins such, no libraries, or of - stock arduino 10 leds , 10 resistors.
i used "lightbar" because handy, made small footprint. t1 leds fit within confines of small protoboard or "proto-shield".
the arduino paradigm focusses on digitalwrites, have made lot of flicker. the key "port manipulation", poking (as used in c64 basic) portb , portd registers, getting data out in parallel. actually, there 2 such operations: portb chunk , portd chunk.
i arranged array of "frames" composed of 12 words each, bits 2 - 11 correspond digital pins.
in following examples, "frame 1" begins leading led in bit 7 , in "frame 2" it's in bit 8.
long story short: brighter led supposed be, greater number of times shows in frame's words.
in sketch (pde attached), each word gets read , split 2 bytes written respective port registers. the sketch grabs each line @ machine speed, strafes. the variable times_out sets speed, it's number of times 12 lines in "frame" read , output (put out?).
in demo, times_out = 7500 makes leisurely procession; 100 make solid bar while 100000 agonisingly slow.
http://www.youtube.com/watch?v=o66bi_jeboq
sorry if it's little blurry, should idea, , put together, upload sketch , enjoy.
[so, "noobs", et al., grab sketch , place in file same name (larsonviaportbd). ]
> > > while tending request, found discontinuity in 1 of dimbit[] words , corrected in larsonviaprotbd_b.pde
first, there lot of led back-and-forth, running lights jobs out there; many of them claiming "larson scanners". but "larson scanner" needs trail of dimmer lights following leading light. whether inventor such i'm not sure, when glen larson did these battlestar galactica (cylons) , knight rider (kitt), used light bulbs , bulbs' incandescence (their residual glow) made trailing effect.
leds go on/off rapidly, there's no continuing glow-down when go off, no gradual fade out.
so - how done leds?
whip out arduino? good start, still.
use pwm pins? there six.
charlieplex? stop already.
glom "library"? not me.
off-board circuitry, max-blah-blah? totally unnecessary.
i worked out 10 positions.
i didn't use pwm pins such, no libraries, or of - stock arduino 10 leds , 10 resistors.
i used "lightbar" because handy, made small footprint. t1 leds fit within confines of small protoboard or "proto-shield".
the arduino paradigm focusses on digitalwrites, have made lot of flicker. the key "port manipulation", poking (as used in c64 basic) portb , portd registers, getting data out in parallel. actually, there 2 such operations: portb chunk , portd chunk.
i arranged array of "frames" composed of 12 words each, bits 2 - 11 correspond digital pins.
in following examples, "frame 1" begins leading led in bit 7 , in "frame 2" it's in bit 8.
code: [select]
// 11
// 1098765432
const word dimbits[] = { 0b0000000011111100, // frame 1
0b0000000011111000,
0b0000000011110000,
0b0000000011100000,
0b0000000011000000,
0b0000000010000000,
0b0000000010000000,
0b0000000010000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
// 1098765432
0b0000000111111000, // frame 2
0b0000000111110000,
0b0000000111100000,
0b0000000111000000,
0b0000000110000000,
0b0000000100000000,
0b0000000100000000,
0b0000000100000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
long story short: brighter led supposed be, greater number of times shows in frame's words.
in sketch (pde attached), each word gets read , split 2 bytes written respective port registers. the sketch grabs each line @ machine speed, strafes. the variable times_out sets speed, it's number of times 12 lines in "frame" read , output (put out?).
in demo, times_out = 7500 makes leisurely procession; 100 make solid bar while 100000 agonisingly slow.
http://www.youtube.com/watch?v=o66bi_jeboq
sorry if it's little blurry, should idea, , put together, upload sketch , enjoy.
[so, "noobs", et al., grab sketch , place in file same name (larsonviaportbd). ]
> > > while tending request, found discontinuity in 1 of dimbit[] words , corrected in larsonviaprotbd_b.pde
this similar , has been "out there" long time now:
http://blog.blinkenlight.net/experiments/basic-effects/knight-rider/
http://blog.blinkenlight.net/experiments/basic-effects/knight-rider/
Arduino Forum > Using Arduino > LEDs and Multiplexing > Larson Scanner, Anyone?
arduino
Comments
Post a Comment