mkrMotorCarrier

Connection to Arduino MKR Motor Carrier

Description

This object represents a connection to an MKR Motor Carrier. To communicate with the peripherals connected to MKR Motor Carrier, you can create connections to the peripherals using Object Functions.

Note

The support for mkrMotorCarrier and MKRMotorCarrier library is being removed in a future release. Use motorCarrier, and MotorCarrier library instead.

Creation

Description

example

mkrObj = mkrMotorCarrier(arduinoObj) creates a connection to MKR Motor Carrier board.

Input Arguments

expand all

Arduino hardware connection created using arduino, specified as an object.

Example: mkrObj = mkrMotorCarrier(arduinoObj) creates a connection to the MKR Motor Carrier on the specified arduino object.

Properties

expand all

This property is read-only.

I2C serial clock pin on the Arduino hardware used by MKR motor carrier.

Example:

>> mkrObj.SCLPin
ans = 
      'D12' 

Data Types: char

This property is read-only.

I2C serial data pin on the Arduino hardware used by MKR motor carrier.

Example:

>> mkrObj.SDAPin
ans = 
      'D11' 

Data Types: char

I2C device address, specified as a character vector that represents a hexadecimal value.

Example:

>> mkrObj.I2CAddress

ans = 
    102

Data Types: double

Object Functions

Use these object functions to use the peripherals on the MKR Motor Carrier.

dcmotor
rotaryEncoder
pidMotor
servo

Examples

Create Connection to MKR Motor Carrier

Create an arduino object with MKR Motor Carrier library.

arduinoObj = arduino('COM13','MKR1000','Libraries','MKRMotorCarrier')
arduinoObj =   
   
    arduino with properties:

                  Port: 'COM13'
                 Board: 'MKR1000'
         AvailablePins: {'D0-D14', 'A0-A6'}
  AvailableDigitalPins: {'D0-D14', 'A0-A6'}
      AvailablePWMPins: {'D0-D8', 'D10', 'A3-A4'}
   AvailableAnalogPins: {'A0-A6'}    
    AvailableI2CBusIDs: [0]
             Libraries: {'MKRMotorCarrier'}
Show all properties

Create a connection to the MKR Motor Carrier

mkrObj = mkrMotorCarrier(arduinoObj)
mkrObj =   
   
   MKRMotorCarrier with properties:
              SCLPin: 'D11'
              SDAPin: 'D12'    
          I2CAddress: 102 ('0x66')

Introduced in R2020a