Read data from digital pin on BBC micro:bit board
Create a connection to BBC micro:bit board and read digital pin P5.
microbitObj = microbit('COM3'); dp5 = readDigitalPin(microbitObj,'P5')
dp5 = 0
microbitObj— BBC micro:bit hardware connection
BBC micro:bit hardware connection, specified as a
created with the
pin— Digital pin number
Digital pin number on BBC mico:bit board, specified as a character vector.
value— Value acquired from digital pin
Value acquired from the digital pin, returned as a numeric double.