readDigitalPin

Read data from digital pin on BBC micro:bit board

Description

example

value = readDigitalPin(microbitObj,pin) reads data from the digital pin on the BBC mico:bit board, specified as a microbit object.

Examples

collapse all

Create a connection to BBC micro:bit board and read digital pin P5.

microbitObj = microbit('COM3');
dp5 = readDigitalPin(microbitObj,'P5')
dp5 =

0

Input Arguments

collapse all

BBC micro:bit hardware connection, specified as a microbit object created with the microbit function.

Digital pin number on BBC mico:bit board, specified as a character vector.

Example: 'P5'

Output Arguments

collapse all

Value acquired from the digital pin, returned as a numeric double.

Introduced in R2017b