🛠 Premier clignotement d'une LED cousue
Objectives
Get familiar with the LilyPad Arduino SimpleSnap: clip on the 3.7 V LiPo battery, wire a LilyPad LED with conductive thread, upload the first sketch, and make a sewn LED blink. Understand the role of setup/loop, digitalWrite, and the pinout of the pads.
Materials
- 1 LilyPad Arduino SimpleSnap board (ATmega328P @ 8 MHz, integrated 110 mAh LiPo, snap buttons instead of sewable pads)
- 1 LilyPad LED (with integrated series resistor) and conductive thread, or two snap buttons
- 1 Arduino "USB Serial" FTDI adapter + USB cable
- Arduino IDE, with the "LilyPad Arduino" board selected (ATmega328P option for boards sold from 2012 onwards)
- >
Complete code
// Clignotement LED embarquée — LilyPad SimpleSnap (ATmega328P @ 8 MHz)
const uint8_t LED = 13; // LED verte embarquée (pastille 13)
void setup {
pinMode(LED, OUTPUT); // la pastille devient une sortie
}
void loop {
digitalWrite(LED, HIGH); // LED allumée
delay(500); // 500 ms — le timing est identique à 8 MHz
digitalWrite(LED, LOW); // LED éteinte
delay(500);
}
Expected verification
The onboard LED blinks at 1 Hz (500 ms on, 500 ms off), running autonomously once the 3.7 V battery is clipped on. A sewn LED between pad 13 and the "−" pad blinks identically. The upload succeeds with the "LilyPad Arduino" board selected and the FTDI adapter connected to the corresponding pads.
Common errors
- Wrong board selected during upload (ATmega168 instead of ATmega328P): the sketch is rejected or the timing is incorrect.
- Conductive thread connecting "+" and "−": short circuit; above 5.5 V or with reversed polarity, the board is destroyed (official warning).
- LED sewn in reverse: an LED only conducts in one direction, so the thread must be reversed.
- Connecting the battery or FTDI adapter while the board is powered: handle the battery and adapter cable only when disconnected, before clipping them on.
Other tutorials for this board
Code examples for this board
clignotante.inoArduinobouton-led.inoArduinopwm-respiration.inoArduinoluxmetre-couture.inoArduinointerrupteur-tilt.inoArduinoservo-balayage.inoArduino