Shop OBEX P1 Docs P2 Docs Learn Events
setting OUTC low — Parallax Forums

setting OUTC low

Hi All - FYI, I'm using a BS2.

My eyes began to cross at midnight while reading through the Stamp programming reference looking for a way to set the group of pins, OUTC, all low with one command.

I wound up setting Pins 8, 9, 10, 11 low individually as a work-around.

Anyone know of a command that will set pin group OUTC low with one command?

Thanks much,

DJ

Comments

  • If they are already outputs, then
    OUTC = 0
    
    would do it. If not, you then you also need
    DIRC = %1111
    
  • If they are already outputs, then
    OUTC = 0
    
    would do it.

    Thanks Tom - I'll give it a go tonight.

    Dave
  • davejames,

    Refer to page 83 of the BASIC Stamp Manual.
    On power-up or reset all memory locations become 0.
    Thus:
    The pin directions will all be inputs since a 0 in DIRx makes a pin an Input.
    Also the output levels will all be low since a 0 in OUTx makes a pin output Low.

    Usually you will see a "DIRx = something" statement near the top of the program and it might be followed by an OUTx.
  • Genetix wrote: »
    Refer to page 83 of the BASIC Stamp Manual.

    Smile! I forgot about the physical book. I was digging through the on-line version that's included with the programming environment.

    Thanks for the pointer & reminder.

    DJ
  • davejames wrote: »
    If they are already outputs, then
    OUTC = 0
    
    would do it.

    Thanks Tom - I'll give it a go tonight.

    Dave

    Tom - that was the ticket! Thanks much.

    Dave
Sign In or Register to comment.