Shop OBEX P1 Docs P2 Docs Learn Events
changing state of all outputs at once — Parallax Forums

changing state of all outputs at once

realolmanrealolman Posts: 65
edited 2007-10-21 15:44 in BASIC Stamp
is there a way on the BS2 to change the state of all, or perhaps a group of output pins at once?

For example, the number 255 could be used to set a group of 8 pins all high with one command.

Comments

  • Steve JoblinSteve Joblin Posts: 784
    edited 2007-10-21 13:32
    the "DIRS=" directive will do just that!
  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-21 14:18
    The DIRS= will set a group of pins as inputs or outputs while the OUTS= will set the state of a group of output pins (actually will set the output register). Similarly, INS provides the state of a group of input pins. Look at the memory section of the PBasic Manual for details. There are names defined for various subgroups (8 bit bytes, 4 bit nibbles) as well.
  • realolmanrealolman Posts: 65
    edited 2007-10-21 15:44
    Thank you very much.
Sign In or Register to comment.