DocumentationHelp Center
Read analog pin voltage on BBC micro:bit board
voltage = readVoltage(microbitObj,pin)
example
voltage = readVoltage(microbitObj,pin) reads the voltage on the analog input pin on the BBC mico:bit board, specified as a microbit object.
voltage
microbitObj
pin
collapse all
Create a BBC micro:bit object and read voltage from an analog pin.
microbitObj = microbit('COM3'); vp10 = readVoltage(microbitObj,'P10')
vp10 = 3.3000
BBC micro:bit hardware connection, specified as a microbit object created with the microbit function.
microbit
Analog pin number on the BBC micro:bit board, specified as a character vector.
Example: 'P0'
'P0'
Voltage read from the analog pin on BBC micro:bit board, specified as a numeric double.
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