May 11, 2024, 01:02:06 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.


Using vmusic2 and prop1 only with a low input trigger

Started by reddragon, April 07, 2009, 07:44:15 PM

Previous topic - Next topic

reddragon

 Hi Jon, I was looking in the forms and seen diffent ways to wright codes for the vmusic2 useing differnt add on like fc-4s and pir. There is one that you have wrote and it uses a high input for a trigger. For mine i will be using a mat switch in and scince its not a high input i was needing a starting step if you have the time with a low input trigger i would like do have a sampel to look over and study. Thanks Jon

JonnyMac

The mat switches I've seen are just normally-open push-buttons.  If you connect one lead to Px.W (usually P6.W) and the other lead to Px.R you get an active-high input.  If using P6 then move the SETUP jumper to the DN position.  You can use P0 to P5 as well because the ULN has a pull-down on its input.

The I use the same trigger loop for any active-high input, PIR or N.O. button:

Main:
  timer = 0                                     ' reset timer

Check_Trigger:
  PAUSE 5                                       ' loop pad
  timer = timer + 5 * Trigger                   ' update timer
  IF timer < 100 THEN Check_Trigger             ' wait for 0.1 sec input
Jon McPhalen
EFX-TEK Hollywood Office