DocumentationHelp CenterDocumentation
Write to digital pin on BBC micro:bit board
writeDigitalPin(microbitObj,pin,value)
example
writeDigitalPin(microbitObj,pin,value) writes the value to the pin on the BBC mico:bit board, specified as a microbit object.
microbitObj
pin
value
collapse all
Write a value to digital pin P5.
microbitObj = microbit('COM3'); writeDigitalPin(microbitObj,'P5',1)
BBC micro:bit hardware connection, specified as a microbit object created with the microbit function.
microbit
Digital pin number on BBC micro:bit board, specified as a character vector.
Example: 'P5'
'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.
0
1
true
false
configurePin | readDigitalPin
configurePin
readDigitalPin
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office