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.

writeDigitalPin

Write to digital pin on BBC micro:bit board

Syntax

writeDigitalPin(microbitObj,pin,value)

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