Shop OBEX P1 Docs P2 Docs Learn Events
Can anyone share a simple pulsin schematic? — Parallax Forums

Can anyone share a simple pulsin schematic?

TonyATonyA Posts: 226
edited 2005-08-24 13:48 in BASIC Stamp
Hi,

I am looking for a simple schematic for use with a pulsin program. I know there should be a resistor and a cap, and a line to the +5, but not sure exactly how to set this up. Should there be a 220 k ohm resistor before the input pin too?

My idea is to create a simple all notes off midi switch using the pulsin command like this:

Allnotes_off:
PULSIN 6, 1, pulse
IF pulse >=1 THEN
SEROUT MidiOut, Baud, [noparse][[/noparse]$B0, $7B, $00]
ENDIF


Or would this be better (using rctime)?


Allnotes_off:
HIGH 6
PAUSE 1
RCTIME 6, 1, pause_result
IF pause_result >=1 THEN
SEROUT MidiOut, Baud, [noparse][[/noparse]$B0, $7B, $00]
ENDIF

Thank you,
Tony

Post Edited (TonyA) : 8/24/2005 12:00:09 PM GMT

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-08-24 12:10
    Why not just scan a button and if it's pressed send the All Notes Off message?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • TonyATonyA Posts: 226
    edited 2005-08-24 13:05
    Hi,

    I did this:

    Notes_Off:
    IF IN6 =0 THEN
    SEROUT MidiOut, Baud, [noparse][[/noparse]$B0, $7B, $00] ' send out on channel 0
    ENDIF
    DEBUG ? IN6

    I get state readings from the pin (pin 6), but no effect on the notes, they don't turn off. Maybe because the channel for all notes off is different. I have to see.

    Thank you,
    Tony

    Post Edited (TonyA) : 8/24/2005 1:13:57 PM GMT
  • TonyATonyA Posts: 226
    edited 2005-08-24 13:48
    Yup, that worked. I changed $7B (all notes off) to $78 (all sounds off).
    Thanks.
Sign In or Register to comment.