Reference   Language | Libraries | Comparison | Changes

Robot

digitalWrite()

Description

Write a HIGH or a LOW value to the defined port on the robot. the ports are exposed on the robot as TinkerKit connectors.

Syntax

Robot.digitalWrite(port, value)

Parameters

port: TKD0 to TKD5 (on the Control board), B_TK1 to B_TK4(on the Motor Board), or LED1 (located on the control board)

value: HIGH or LOW

Returns

none

Examples

#include <ArduinoRobot.h>
void setup(){
  Robot.begin();
}

void loop(){
  Robot.digitalWrite(TDK0, HIGH); // Turn on a Tinkerkit LED connected to TDK0
  delay(1000);
  Robot.digitalWrite(TK0, LOW); // Turn the LED off
  delay(1000);
}

Note

You cannot call Robot.digitalWrite() on TK0 to TK7

Control Board

Motor Board

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.

Share