This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Write to digital pin on BBC micro:bit board





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


collapse all

Write a value to digital pin P5.

microbitObj = microbit('COM3');

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