irSensor
Connection to infrared sensor
Add-On Required: This feature requires the MATLAB Support Package for LEGO MINDSTORMS EV3 Hardware add-on.
Description
This object represents a connection to an EV3 Infrared Sensor (item number 45509). To get the relative distance of an object in front of the sensor, or to get data from an EV3 Remote Infrared Beacon (item number 45508), use this object with the functions listed in Object Functions.
Creation
Description
creates a connection to an infrared sensor. You can use this connection with the functions
listed in Object Functions to get the relative distance of an object in front of the
sensor, or to get data from an EV3 Remote Infrared Beacon.myirsensor
= irSensor(myev3
)
If multiple infrared sensors are attached to the EV3 brick, this function chooses the sensor that is attached to the EV3 input port with the lowest number.
creates a connection to an infrared sensor that uses a specific EV3 input port by the
InputPort
property.myirsensor
= irSensor(myev3
,inputport
)
Input Arguments
Output Arguments
Properties
Object Functions
readProximity | Read distance from infrared sensor to object |
readBeaconProximity | Read distance and heading from infrared sensor to beacon |
readBeaconButton | Read number of pressed button on infrared beacon |