Changing the pin mode on loop

Hi

Im creating an arduino based programmable 16 pin chip tester and I need to set any digital IO to either in or out on the loop part of the code, can it be done?

If so does anyone have info on how to do it avoiding any damage to the bootloader program.

Any help will be greatly appreciated. ::slight_smile:

can it be done?

pinMode() can be used anywhere. It is not limited to setup().

If so does anyone have info on how to do it avoiding any damage to the bootloader program.

Don't upload code with anything attached to pins 0 and 1. Then, you can't possibly damage the bootloader, regardless of the mode of those pins.