November 22, 2024, 08:10:01 PM

News:

You can now use Vixen to program your Prop-1 and Prop-2 controllers!  Get started quickly and easily, without having to learn PBASIC.  Details in the Library forum.


Can variables be used in FC4 serial commands?

Started by steveo, March 06, 2008, 11:18:26 AM

Previous topic - Next topic

steveo

Jon,
[As always, my standard disclaimer applies]

In the command string for FC4 serial code, specifically if I was using "L" to set levels, can I substitute the level setting with a variable?

For instance:

SEROUT, TX, Baud, ["!FC4", %00, "L", 1,  XXX] - wherein "XXX" is a variable, rather than the channel level?

Thanks much!

JonnyMac

March 06, 2008, 11:56:34 AM #1 Last Edit: March 06, 2008, 11:58:36 AM by JonnyMac
Absolutely, you can create your own fades/cross-fades by send the values manually with in a loop.  Remember that there is a small serial delay, so you'll want to account for that.

Here's a snippet from the BS2 test program that demonstrates this with the D (digital) command:

Digital_Control:
  DEBUG CR, "Digital Control", CR
  FOR idx = %0000 TO %1111
    SEROUT Sio, Baud, ["!FC4", %00, "D", idx]
    PAUSE 200
    GOSUB Show_Status
  NEXT


In the end, the BASIC Stamp doesn't care if you use a variable or constant. 
Jon McPhalen
EFX-TEK Hollywood Office

steveo

You just made my day. I sense another long night in the Garage of Evil..