🛠 Faire clignoter la LED D7 du Photon

Particle Photon · debutant · Schéma : IMG-particle-photon-debutant-1-photon-clignotement-led.svg — Photon sur breadboard, LED jaune D7 et câble micro-USB mis en évidence

Objectives

Discover the Photon's Wiring programming model (setup and loop functions), control the user LED connected to pin D7, and understand that the firmware is split between the Device OS (FreeRTOS system, radio, and cloud) and your small C/C++ application.

Hardware

Complete Code

// photon-clignotement-led.ino — clignotement de la LED utilisateur D7
const int LED_PIN = D7;   // LED jaune utilisateur sur D7

void setup {
  pinMode(LED_PIN, OUTPUT);
  Serial.begin(9600);       // trace série sur l'USB
}

void loop {
  digitalWrite(LED_PIN, HIGH);
  Serial.println("LED ON");
  delay(500);
  digitalWrite(LED_PIN, LOW);
  delay(500);
}

Expected Verification

The yellow D7 LED blinks every 500 ms immediately after startup. The RGB LED breathes cyan when the Photon is connected to the Particle Cloud (breathing cyan = online, confirmed by the datasheet). Compile and flash using particle flash <device_name> . or particle flash <name> firmware.bin; the message “LED ON” appears on the serial port at 9600 bauds.

Common Errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials