Arduino Function: RobotControl.digitalRead

Description

This method reads the digital value in a specified port. These are exposed as TinkerKit connectors on the robot.

Syntax

Robot.digitalRead(portName)

Parameters

The parameter port must be a valid name. Here's a list *TK0 to TK7 (found on the Control board) *TKD0 to TKD5 (on the Control board) *B_TK1 to B_TK4 (on the Motor Board)

Returns

 HIGH or LOW

Examples

#include 
void setup(){
  Robot.begin();
  Serial.begin(9600);
}
void loop(){
  Serial.println(Robot.digitalRead(TK0)); //Print the value read on port TK0
  delay(100);
}


Based on the reference originally written by Arduino Community,  wiring.org.co and  arduino.cc