writeDigitalPin

Write to digital pin on BBC micro:bit board

Description

example

writeDigitalPin(microbitObj,pin,value) writes the value to the pin on the BBC mico:bit board, specified as a microbit object.

Examples

collapse all

Write a value to digital pin P5.

microbitObj = microbit('COM3');
writeDigitalPin(microbitObj,'P5',1)

Input Arguments

collapse all

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

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

Example: 'P5'

Value of digital data to write to the specified pin on BBC micro:bit board, specified as a logical value of 0 and 1 or true and false.

Introduced in R2017b