For this exercise, we will need:
Power off the board and attach the components to BeagleBone as shown in the preceding diagram.
Let's see the analysis step by step:
1
and pole 2
are already connected. Another side has pole 3
and pole 4
connected. But these both sides are not connected to each other. When the button is pressed, the pole 1
and pole 2
side gets connected to the pole 3 and pole 4
side.P9_3
and P9_4
are not regular GPIO
pins but provide continuous 3.3 voltage. They are useful to provide voltage to electronics components. Here, we apply 3.3V
to pole 4
and the current is stuck there until the button is pressed. Once the button is pressed, pole 4
is connected to pole 1
. We have joined pole 1
to P8_16
, which is in input mode. The circuit get completed and current starts flowing from P9_3
to P8_16
. If we read pin P8_16
now, we will get the value HIGH
.1
and pole 4
are disconnected and the circuit gets broken. Now, if we read pin P8_16
from our program, we will get the value LOW
. In our program, we will print whatever value we find.3.16.137.38