added functions for controlling gpio