Test your knowledge
When we send a high value (1) to a GPIO pin configured as output, the GPIO pin will have:
0 V.
6 V.
The voltage specified in the position in which the IOREF jumper is located.
An instance of the
mraa.Gpio
class represents:A single GPIO pin in the board.
All the I/O pins in the board.
Two GPIO pins in the board.
When we create an instance of the
mraa.Gpio
class, we must specify:The pin number as an argument.
The specific board and a pin number as arguments.
The pin number and the desired direction:
mraa.DIR_OUT
ormraa.DIR_IN
.
Which of the following lines write a high value to the GPIO pin configured as output with the instance of
mraa.Gpio
namedgpio10
:gpio10.write(0)
gpio10.write(1)
gpio10.write(mraa.HIGH_VALUE)
Which of the following lines configure the instance of
mraa.Gpio
namedgpio10
for digital output:gpio10.dir(mraa.DIR_DIGITAL).out()
gpio10.dir(mraa.DIR_OUT)
gpio10.dir(mraa.DIR_OUT, mraa.DIGITAL)