November 22, 2024, 07:52:25 PM

News:

Got VSA?  Want to use your Prop-SX?  Now you can!  See the VSA section of the Library forum for Prop-SX code that works with VSA.


DC-16 to control LED's for Candle Flicker

Started by hauserj, October 18, 2007, 08:37:53 AM

Previous topic - Next topic

hauserj

Just received a DC-16.  My intended use is for on/off control (foggers, 120v lights, solenoids, relays, etc).

I had a thought - Was wondering if the serial communications (at 2400B for the prop-1) and processing of the serout commands is fast enough to control LED flickering for candle simulation.
Not sure if I have time to give this a try before the Holiday.

Anyone tried this?
Has this been posted before?
Thoughts as to feasibility?
Any existing code for candle flicker through dc-16 (I use the existing candle flicker routines for prop-1 downloaded from this site)

thanks
Jim

JonnyMac

It's really tough at 2400 baud.  Consider this transmission:

  SEROUT Sio, OT2400, ("!DC16", %00, "H", rndBits)

There are eight bytes transmitted, and at 2400 baud each byte takes 4.17 ms, so the entire packet takes 33 milliseconds -- this is a little long and, more importantly, would require the Prop-1 to be in a very tight loop that is constantly resending a random value.  Next season we'll have "smart" wicks that don't required anything but an "on" signal and that will make these kinds of situations simpler.
Jon McPhalen
EFX-TEK Hollywood Office

hauserj

Thanks John,


I'll try this when I get some time after the season. 
I actually put a delay in the original posted flicker routine because i like the look of a slower flicker.
Perhaps the 33 millisecond delay wont be so bad.
I'll let you know how it looks.

jumblo 

JonnyMac

October 18, 2007, 09:20:02 PM #3 Last Edit: October 19, 2007, 07:26:58 AM by JonnyMac
Then just generate a random number and blast it out.  We do suggest running RANDOM three times before sending to parallel outputs -- it just looks better; like this:

Update_Candles:
  FOR idx = 1 TO 3
    RANDOM wicks
  NEXT
  SEROUT Sio, Baud, ("!DC16", %00, "L", wicks)
  GOTO Update_Candles
Jon McPhalen
EFX-TEK Hollywood Office