Changing pin directions mid program
agentile
Posts: 101
Hello,
·· I have a program which requires that a single pin is·configured as an input for part of the program and as an· output for another part of the program.· Using INX and OUTX requires that I initialize my pins with DIRX.· Can I re-initialize pins during the program?· Example:· with the following code work to read and write from the same pin?
DIR1=0
bit_in = IN1
DIR1=1
OUT1=bit_out
thanks,
agentile
·· I have a program which requires that a single pin is·configured as an input for part of the program and as an· output for another part of the program.· Using INX and OUTX requires that I initialize my pins with DIRX.· Can I re-initialize pins during the program?· Example:· with the following code work to read and write from the same pin?
DIR1=0
bit_in = IN1
DIR1=1
OUT1=bit_out
thanks,
agentile
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax