Fade the EagLED eyes
Use PWM to change the average brightness of the two red eye LEDs.
Use PWM to change the average brightness of the two red eye LEDs.
Designed for the intact EagLED v1.2 with buzzer. Start with USB power; no cutting or sewing is required.
Step 1 — Prepare the intact EagLED
Use an intact black EagLED v1.2 with buzzer, a micro-USB data cable and a computer. The LEDs, button and light sensor are already connected by PCB traces. You do not need jumper wires, a breadboard, external resistors or a separate Arduino.
Keep the board uncut for this project. Place it on a dry, non-conductive surface. Leave the battery socket empty, connect USB and move the main board switch to ON. Move the separate switch beside the buzzer to OFF for quiet LED and sensor experiments.
The 3D view follows this starter program and its controls. It illustrates the mechanism; it does not execute changes made in the code editor or measure a connected board.
Step 2 — Explore the result in 3D
Drag Brightness to compare 0, 128 and 255. Press Play for a fade. On the real board both eyes should brighten and dim together. Drag to orbit, inspect a named component, and use Top or Underside to follow the real board layout.
Step 3 — Program your EagLED
The English IDE below opens with Little Bird EagLED and Arduino C++ selected. Read the English instructions beside the supplied program, then press Verify to compile it for this board.
To program your physical board, download the same sketch below and open it in Arduino IDE. Install the Little Bird AVR board package, choose Little Bird EagLED and its USB port, then Verify and Upload. Follow the EagLED setup guide if this is your first upload. Upload replaces the factory light pattern.
EagLED uses an ATmega32U4 at 8 MHz. Do not choose Uno or a 16 MHz Leonardo profile. Its USB port can change while the bootloader is active. If upload fails, check the selected port and retry after pressing the centre board’s reset button. The triangular project button is not reset. Close any browser serial connection before uploading from Arduino IDE.
Step 4 — Keep a copy of the complete program
const byte LEFT_EYE = 3;
const byte RIGHT_EYE = 10;
const unsigned long STEP_MS = 4;
void setup() {
pinMode(LEFT_EYE, OUTPUT);
pinMode(RIGHT_EYE, OUTPUT);
}
void loop() {
for (int brightness = 0; brightness <= 255; brightness++) {
analogWrite(LEFT_EYE, brightness);
analogWrite(RIGHT_EYE, brightness);
delay(STEP_MS);
}
for (int brightness = 254; brightness >= 1; brightness--) {
analogWrite(LEFT_EYE, brightness);
analogWrite(RIGHT_EYE, brightness);
delay(STEP_MS);
}
}
This is the same complete Arduino C++ program used by the English IDE. Copy it or download the .ino file.
Step 5 — Understand the program
analogWrite sends a PWM command from 0 to 255. It switches a 3.3 V output on and off rapidly; it does not produce a steady adjustable analog voltage. The duty cycle is the fraction of each pulse cycle spent HIGH. Your eye sees an average brightness.
analogWrite(LEFT_EYE, brightness);
analogWrite(RIGHT_EYE, brightness);Both eyes receive the same command each step. int brightness can hold signed values, so counting down is safe. The downward loop skips 255 and 0 because the neighbouring upward loops already display them. There are 510 brightness steps per full fade.
Step 6 — Work through one case
| Command | Approximate duty cycle | What changes |
|---|---|---|
| 0 | 0% | Output stays LOW |
| 128 | 50% | About half the time HIGH |
| 255 | 100% | Output stays HIGH |
At 4 ms per step, a full fade takes about 2.04 s plus a small amount of instruction time. Perceived brightness is not perfectly proportional to the number.
Step 7 — Test it on your board
Drag Brightness to compare 0, 128 and 255. Press Play for a fade. On the real board both eyes should brighten and dim together.
Check the physical output after uploading. Successful compilation confirms syntax and board compatibility; the 3D illustration cannot confirm your board’s USB connection or electrical operation.
Step 8 — Predict, change and compare
Predict the fade duration if STEP_MS changes from 4 to 8. Change only that constant, upload, and time five fades. Keep the same pins and room light. Restore 4 afterwards.
Check your reasoning after trying it
The delay portion doubles to 4.08 s per fade, or about 20.4 s for five. This changes the envelope speed, not the PWM hardware carrier frequency.
Step 9 — Find and fix a problem
A heart switches instead of fading: D1 and D12 do not provide hardware PWM. Use D3, D10 or D6. Fading is subtle at low values: compare in steady room light; visual brightness is not linear.
Nothing responds: check the main switch, the power indicator and a known data-capable USB cable. Confirm the EagLED board profile and USB port. If the board has already been snipped apart, its original connections are broken: follow a separate sewable wiring project before using this intact-board sketch.
Step 10 — Keep exploring
Continue through the EagLED experiments or open the full board explorer. The original EagLED schematic and manufacturing files document the pin connections.
Parts List
Required Parts (1)
Keep the board intact. Also bring a micro-USB data cable and computer. No additional sensor, LED, Arduino or breadboard is required.
x1
$34.35
In stockProject Summary
1 part total
Unavailable items will be skipped