danrubel / rpi_gpio.dart

Dart library for accessing the Raspberry Pi GPIO pins
Other
47 stars 5 forks source link

How to convert the input and output mode of GPIO? #19

Open tsuiwade opened 3 years ago

tsuiwade commented 3 years ago

I'm using GPIO to simulate the timing of a 'one bus' device. I need GPIO to go from output mode to input mode.

var output = gpio.output(36);
var input= gpio.input(36);

Then, the error shows

Unhandled exception:
Already allocated pin: 36

Do I need to release first?

gpio.dispose(); ?

plz help!