Shop OBEX P1 Docs P2 Docs Learn Events
Need Simple Code to Show I/O — Parallax Forums

Need Simple Code to Show I/O

jbodjbod Posts: 46
edited 2008-03-06 02:46 in Robotics
What would be the best (simple) code to setup at the begining of a program to show (BEBUG) the current state of all I/O pins?

Thanks in advance!!!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-03-06 01:49
    Assuming you're talking about a Stamp, you can do "DEBUG BIN16 INS,CR".
    This will display the 16 I/O pins as 16 bits on a single line. You can also use
    the HEX4 formatter to display the information in 4 hexadecimal digits.
  • jbodjbod Posts: 46
    edited 2008-03-06 02:07
    Thanks for the quick response Mike!!!



    Yes I am talking about a BS2 stamp ... I am setting up a XBEE AppBee board and they indicate to make sure all I/O is set to IN·so to not damage the Xbee's ... I was pretty sure by default, all BASIC Stamp I/O pins are set to inputs ... but want to put it in the code to see it to be safe [noparse]:)[/noparse]
  • Mike GreenMike Green Posts: 23,101
    edited 2008-03-06 02:46
    What I wrote does not set the pins to input. It just displays the value of the input register. By default, all I/O pins are set to input mode when the program starts. To make it explicit, you can put "DIRS = 0" which will set them all to input explicitly.
Sign In or Register to comment.