November 23, 2024, 12:06:17 AM

News:

Be sure to checkout our Vixen interfaces in the Library forum -- if you want PC automation at near zero cost, EFX-TEK and Vixen is a great combination of tools.


Flickering light program

Started by dgme, October 08, 2011, 07:37:22 AM

Previous topic - Next topic

dgme

Hello,

I'm excited, I'm setting up my first Prop-1 to FC-4 connection and I was wondering if someone has a code for the effect of lights flickering and fading like they might die.  I also have a question about the setup.  I have 6, 25W lightbulbs in different rooms that I would like to have this effect on.  I know each channel can power up to 300W so should I run them all off one channel or do 2,2,1, and 1?  Or does it just depend on how the code is set up?  Thanks.

bsnut

No, I don't have one. But, if you look under documents of this site you will find FC-4 PDF that will provide you with a demo program.

To answer your question about the wattage of each channels, I think it is around 150 watts per channel. The FC-4 document will answer this question as well.
William Stefan
The Basic Stamp Nut

JonnyMac

October 08, 2011, 10:33:57 AM #2 Last Edit: October 08, 2011, 10:36:00 AM by JonnyMac
Here's a program to try; do review the FC-4 docs for connections, setup jumpers, etc.

Sorry... my FC-4 demo is on loan so I can only write and compile this program; that said, it's pretty easy and I think it will work for you.  Please study it so you can make adjustments once you have everything up and running.

' =========================================================================
'
'   File......
'   Purpose...
'   Author....
'   E-mail....
'   Started...
'   Updated...
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------


' -----[ Revision History ]------------------------------------------------


' -----[ I/O Definitions ]-------------------------------------------------

SYMBOL  Sio             = 7                     ' SETUP = UP; no ULN
SYMBOL  Trigger         = PIN6                  ' SETUP = DN


' -----[ Constants ]-------------------------------------------------------

SYMBOL  Yes             = 1
SYMBOL  No              = 0

SYMBOL  TrOn            = 1                     ' active-high trigger
SYMBOL  TrOff           = 0

SYMBOL  IsOn            = 1                     ' active-high I/O
SYMBOL  IsOff           = 0

SYMBOL  Baud            = OT2400


' -----[ Variables ]-------------------------------------------------------

SYMBOL  ch              = B2
SYMBOL  flicks          = B3
SYMBOL  delay           = B4

SYMBOL  timer           = W4                    ' for debounce loop
SYMBOL  lottery         = W5
SYMBOL   level          =  B10                  ' low byte of lottery


' -----[ Initialization ]--------------------------------------------------

Power_Up:
  PAUSE 100                                     ' let FC-4 power up

Reset:
  PINS = %00000000                              ' all off
  DIRS = %00111111                              ' P5..P0 are outputs

  lottery = 1031

  SEROUT Sio, Baud, ("!FC4", %00, "A")          ' all on


' -----[ Program Code ]----------------------------------------------------

Main:
  IF timer < 100 THEN Flicker
  PAUSE 100
  timer = timer - 100
  GOTO Main

Flicker:
  RANDOM lottery
  ch = lottery & %11 + 1                        ' channel = 1 to 4

  RANDOM lottery
  flicks = lottery // 6 + 3                     ' 3 to 8 "flicks"

  delay = 150

Flick_Again:
  RANDOM lottery
  SEROUT Sio, Baud, ("!FC4", %00, "L", ch, level)
  PAUSE delay
  delay = delay * 7 / 10                        ' shorten delay by 30%
  flicks = flicks - 1
  IF flicks > 0 THEN Flick_Again

Fade_Up:
  SEROUT Sio, Baud, ("!FC4", %00, "F", ch, level, 255, 10)

New_Timer:
  RANDOM lottery
  timer = lottery // 30001 + 30000              ' 30s to 60s
  GOTO Main
Jon McPhalen
EFX-TEK Hollywood Office