Console ASCII Table

This example for the Arduino Yún demonstrates how to print to the Console by generating a table of characters and their ASCII values in decimal, hexadecimal, octal, and binary. For more on ASCII, see

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.

When your Yún and computer are on the same network, you can find the Yún in the Tools>Ports menu item in the Arduino Software (IDE).

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 a variable that will hold the value to print out to the Console window. ASCII characters of values 32 and below are invisible, so initialize the variable with a value of 33 (which corresponds to "!" ).
int byte = 33;

In setup(), initialize the Bridge and Console, and wait for the port to open. Once a connection has been made, print out a small bit of information describing what is going to follow :

void setup() {

  while (!Console) {
    ; // wait for Console port to connect.

  Console.println("ASCII Table ~ Character Map");

In loop(), you will print the value in a number of different formats.

To see the ASCII value of the variable, you can write the byte with Console.write(). The Console interprets all bytes as ASCII characters.

Console.print() prints the value as a string of ASCII encoded decimals by default.

Console.print() and Console.println() can also send strings to the Console window that represent hexadecimal, octal, and binary number values with the appropriate modifier. Console.println() will add newline and carriage return characters to the string, creating a line break in the Console window.

Console.print(thisByte, HEX);    
Console.print(thisByte, OCT);    
Console.println(thisByte, BIN);

In this example, you're only printing out the alphanumeric characters that appear on a USA keyboard, so there's no need to print any values past 126. To make sure all the data gets sent before stopping the sketch, make a call to Console.flush().

if(thisByte == 126) {  

    while(true) {

If the sketch hasn't printed out all the values, increment thisByte before running through the loop() again.

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
  • Console Pixel – Turn an LED on and off through 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