5.3 KiB
5.3 KiB
Installation Guide - D1 Mini Blinkin Emulator
Two Ways to Install
Option 1: PlatformIO (Recommended for VS Code Users)
Step 1: Install PlatformIO
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "PlatformIO IDE"
- Click Install
- Restart VS Code
Step 2: Open the Project
- File → Open Folder
- Select
KrakenKodersAllianceLightsfolder - PlatformIO will auto-detect the project
Step 3: Install Libraries
The libraries should install automatically when you build. If not:
Method A: Through PlatformIO Home
- Click PlatformIO icon in sidebar
- Open "PIO Home" → Libraries
- Search for "Adafruit NeoPixel"
- Click "Add to Project"
- Select your project
Method B: Manual Command
- Open PlatformIO Terminal (bottom toolbar)
- Run:
pio lib install "Adafruit NeoPixel"
Step 4: Configure Your Settings
Edit src/D1Mini_Blinkin_Ready.ino:
#define NUM_LEDS 60 // Your LED count
#define BRIGHTNESS 100 // 0-255
Step 5: Build and Upload
- Connect D1 Mini via USB
- Click checkmark (✓) to build
- Click arrow (→) to upload
Option 2: Arduino IDE (Simpler for Beginners)
Step 1: Install Arduino IDE
Download from: https://www.arduino.cc/en/software
Step 2: Add ESP8266 Board Support
- Open Arduino IDE
- File → Preferences
- In "Additional Board Manager URLs" add:
http://arduino.esp8266.com/stable/package_esp8266com_index.json - Click OK
- Tools → Board → Board Manager
- Search "ESP8266"
- Install "ESP8266 by ESP8266 Community"
Step 3: Install NeoPixel Library
- Tools → Manage Libraries
- Search "Adafruit NeoPixel"
- Click Install
- Also install any dependencies it asks for
Step 4: Open the Sketch
- File → Open
- Navigate to
D1Mini_Blinkin_Arduino.ino
Step 5: Configure Board Settings
Tools menu:
- Board: "LOLIN(WEMOS) D1 R2 & mini"
- Upload Speed: 921600
- CPU Frequency: 80 MHz
- Flash Size: 4MB (FS:2MB OTA:~1019KB)
- Port: Select your COM port (appears when D1 Mini connected)
Step 6: Configure Your LEDs
Edit these lines in the code:
#define NUM_LEDS 60 // Your LED count
#define BRIGHTNESS 100 // 0-255
Step 7: Upload
- Connect D1 Mini via USB
- Click Upload button (→)
- Wait for "Done uploading"
Troubleshooting
PlatformIO Issues
"Adafruit_NeoPixel.h not found"
- Ensure platformio.ini contains:
lib_deps = adafruit/Adafruit NeoPixel@^1.11.0 - Clean and rebuild: PlatformIO → Clean, then Build
"Platform not installed"
- Terminal:
pio platform install espressif8266
Wrong COM Port
- Add to platformio.ini:
upload_port = COM3 ; Change to your port monitor_port = COM3
Arduino IDE Issues
"Board not found"
- Ensure ESP8266 package is installed
- Restart Arduino IDE
- Select correct board from Tools → Board menu
"Port not showing"
- Install CH340 drivers: https://sparks.gogo.co.nz/ch340.html
- Try different USB cable (data cable, not charge-only)
- Windows: Check Device Manager for COM port
"Upload failed"
- Hold FLASH button on D1 Mini while uploading starts
- Release after upload begins
- Try slower upload speed (115200)
General Issues
LEDs not working after upload
- Check wiring (D4 → LED Data)
- Verify LED strip has power
- Test with Serial Monitor for debug output
- Check voltage divider if using servo port
Wrong colors or flickering
- Some LED strips are RGB instead of GRB
- Change in code:
// From: Adafruit_NeoPixel strip(NUM_LEDS, LED_DATA_PIN, NEO_GRB + NEO_KHZ800); // To: Adafruit_NeoPixel strip(NUM_LEDS, LED_DATA_PIN, NEO_RGB + NEO_KHZ800);
Testing Your Installation
Serial Monitor Test
- Open Serial Monitor (115200 baud)
- Should see:
D1 Mini Blinkin Emulator Kraken Koders FTC Team LEDs: 60 Ready!
LED Test
- LEDs should show green sweep on startup
- Without PWM input, LEDs turn off
- With PWM input, patterns change
Simple Blink Test
Upload this minimal test first:
#include <Adafruit_NeoPixel.h>
#define PIN 2 // D4
#define NUMPIXELS 10
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
pixels.begin();
pixels.setBrightness(50);
}
void loop() {
pixels.clear();
pixels.setPixelColor(0, pixels.Color(255, 0, 0));
pixels.show();
delay(500);
pixels.clear();
pixels.show();
delay(500);
}
Next Steps
- Build the voltage divider - See VOLTAGE_DIVIDER_BUILD_GUIDE.md
- Test with servo tester - Verify PWM reading
- Connect to FTC robot - Configure as servo device
- Customize patterns - Add your team colors!
Quick Command Reference
PlatformIO Commands
pio run # Build
pio run -t upload # Upload
pio run -t clean # Clean
pio device monitor # Serial monitor
pio lib install "name" # Install library
Arduino IDE Shortcuts
- Ctrl+R - Verify/Compile
- Ctrl+U - Upload
- Ctrl+Shift+M - Serial Monitor
- Ctrl+Shift+L - Library Manager
Support
If you're still having issues:
- Check all connections with multimeter
- Try the simple blink test first
- Enable DEBUG_MODE in code for more output
- Verify voltage divider output is 2.5-3.3V
- Test with different USB cable/port
Remember: The D1 Mini is 3.3V logic - never connect 5V directly to GPIO pins!