Console Pixel

An example of using the Arduino board to receive data from the Console on the Arduino Yún. In this case, the Arduino board turns the on-board LED connected to digital pin 13 on when it receives the character 'H', and off when it receives the character 'L'.

The Console, based on Bridge, enables you to send information from the Yún to a computer just as you would with the serial monitor, but wirelessly. It creates a secure connection between the Yún and your computer via SSH.

To see the Console, make sure your Yún and computer are in the same wireless network. Pick your Yún's name and IP address in the Port menu in the Arduino Software (IDE) then open the Port Monitor. You can also see it by opening a terminal window and typing ssh root@ yourYúnsName.local 'telnet localhost 6571' then pressing enter. When prompted for the password, enter it.

Hardware Required

  • Arduino Yún
  • computer and Yún on the same wireless network


There is no circuit for this example.

image developed using Fritzing. For more circuit examples, see the Fritzing project page


Include the Console library, which inherits from Bridge.
#include <Console.h>

Create variables and name the pin to write to, and another one to store the incoming byte from the Console.

const int ledPin = 13;
char incomingByte;

In setup() initialize the Bridge and Console, and wait for a connection to the Console port.

void setup() {


Once connected, print out some basic instructions to the Console window with Console.println() and set the LED pin as an output.

Console.println("type H or L to turn pin 13 on or off");

  pinMode(ledPin, OUTPUT);

In loop(), check to see if there is information from the Console. If there is, read the oldest byte in the buffer and echo it back to the Console window.

void loop() {
  if (Console.available() > 0) {
    incomingByte =;

If the incoming byte is a capital "H", turn the LED on, if it is a "L", turn the LED off.

if (incomingByte == 'H') {
      digitalWrite(ledPin, HIGH);
    if (incomingByte == 'L') {
      digitalWrite(ledPin, LOW);

The complete sketch is below :

SORRY, There is an error at our code repository, please inform to

See Also

  • Bridge Library - Your reference to the Bridge Library
  • Bridge – Simple REST style calls to access analog and digital pins
  • Consolle Ascii Table – A complete ASCII table printed to the Console
  • Console Read - Read data coming from bridge using the function
  • Data Logger - Log data from three analog sensors to an SD card.
  • File Write - How to write file into the Yún filesystem.
  • Http Client - A basic HTTP client that connects to the internet and downloads content.
  • Mailbox Read Message - How to read the messages queue, called Mailbox, using the Bridge library.
  • Process - How to run linux processes using an Arduino Yún.
  • Shell Commands - How to run linux shell commands using an Arduino Yún.
  • Temperature Web Panel - How to serve data from an analog input via the Arduino Yún's built-in webserver.
  • Time check - Gets the time from Linux via Bridge then parses out hours, minutes and seconds.
  • WiFi Status - Prints information about the status of your wifi connection.
  • Serial Terminal - Use the Yún's 32U4 processor as a serial terminal for the Linux side on the Yún.

Last revision 2015/08/11 by SM