Skip to content

tlk0s/SpyGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

ESP8266 SpyGame System

This project controls servos, reads a PIR sensor, and drives a WS2812 LED strip for a "Spy Game" setup.

Connection Diagram

Component Pin Notes
Servo Left/Right D7
Servo Up/Down D6
PIR Sensor D5 Signal Pin
WS2812 LED Strip D4 Data Pin
PIR Disable Switch D0 Connect to 3.3V for PATROL, Disconnect for GAME
Green Button D3 Connect to GND (PULLUP)
Yellow Button D2 Connect to GND (PULLUP)
Red Button D1 Connect to GND (PULLUP)

Note on D0 Switch: D0 has an internal pull-down resistor.

  • Patrol Mode: Switch Closed (Connected to 3.3V).
  • Game Mode: Switch Open (Disconnected/Low).

How to Run

Option 1: VS Code (GUI)

  1. Connect Device: Plug your ESP D1 Mini into your computer via USB.
  2. Open Project: Open this folder in VS Code with the PlatformIO extension installed.
  3. Build: Click the Checkmark icon (โœ“) in the bottom PlatformIO toolbar.
  4. Upload: Click the Right Arrow icon (โ†’) to upload.
  5. Monitor: Click the Plug icon (๐Ÿ”Œ) to see serial output.

Option 2: Terminal (CLI)

Run these commands in the project root:

  • Build Project: pio run
  • Upload to Device: pio run --target upload
  • Open Serial Monitor: pio device monitor
  • Upload & Monitor: pio run --target upload -t monitor
  • Clean Build Files: pio run --target clean

Monitoring Debug Output

To see the system status (Inputs, Switch State, Game Mode events):

  1. Run pio device monitor in the terminal.
  2. Or use the Plug Icon (๐Ÿ”Œ) in VS Code.

Debug Output format: [inputs] Switch(D0):1 | PIR(D5):0 | Btns(G/Y/R):1/1/1

  • Switch:1: Patrol Mode (Connected to 3.3V)
  • Switch:0: Game Mode (Open/Low)
  • Btns: 1 = Not Pressed, 0 = Pressed

Troubleshooting

  • Port not found: Ensure you have the correct drivers (CH340 or CP210x).
  • Upload Failed: Hold RESET during "Connecting..." or check cable.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages