Home Page | Language Reference (extended) | SD Reference | Libraries | Comparison | Changes


Robot

IRread()

Description

Get the reading from a specific IR sensor. This can only be called from the Motor Board processor. To read the IR sensors from the Control Board, use updateIR().

Syntax

RobotMotor.IRread(num)

Parameters

num: 1 to 5, corresponding to sensors 1 to 5.

Returns

int : 0 to 1023

Examples

#include <ArduinoRobotMotorBoard.h>
void setup ( ) {
  Serial.begin ( 9600 ) ;
  RobotMotor.begin ( ) ;
}
void loop ( ) {
  Serial.println (RobotMotor.IRread ( 1 ) ) ;
  delay ( 10 ) ;
}

See also


Reference Home

Corrections, suggestions, and new documentation should be posted to the Forum.

The text of the Arduino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.