🛠 Premiers pas sur la Yún : Bridge, Console et LED

Arduino Yún · debutant · Schéma : IMG-yun-debutant-1-yun-premiers-pas-bridge.svg — Arduino Yún vue de dessus, flèches sur la puce ATmega32U4, le SoC Atheros AR9331 avec son blindage radio, le port micro-USB et la LED marquée L.

Objectives

Get to know the most atypical board in the Arduino ecosystem: the Yún combines an ATmega32U4 microcontroller (16 MHz, same family as the Leonardo) and an Atheros AR9331 network SoC (WiFi + Ethernet) running a Linux distribution based on OpenWrt, called Linino OS. This first tutorial lays the foundations: initializing the Bridge library, communicating with the Serial Monitor via Console, and blinking the built-in LED.

Hardware

Complete Code

// Blink version Yún : Bridge + Console au lieu de Serial.
#include <Bridge.h>

const uint8_t LED = 13;

void setup {
  // Sur Yún, ne PAS mettre de while(!Serial) : le port est l'USB natif du 32U4,
  // mais le Bridge, lui, doit attendre qu Linux soit prêt.
  pinMode(LED, OUTPUT);
  Bridge.begin;        // bloque jusqu'à ce que le Bridge côté Linux réponde
  Console.begin;       // Console = flux série acheminé par le Bridge
  Console.println(F("Bridge connecte, Linux est pret"));
}

void loop {
  digitalWrite(LED, HIGH);
  delay(500);
  Console.println(F("LED ON"));
  digitalWrite(LED, LOW);
  delay(500);
  Console.println(F("LED OFF"));
}

In the IDE: Tools > Board > Arduino Yún, select the USB serial port, and upload normally.

Expected Verification

The "L" LED blinks every 500 ms. The Serial Monitor (connected via USB) displays Console messages — but beware: Console goes through the Bridge, so if you open the Monitor AFTER startup, messages already sent are lost. Reconnect the Bridge on the 32U4 side while keeping the Monitor open: Bridge.begin takes a few seconds to complete on the first startup, allowing time for Linino OS to be ready.

Common Errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials