Esp32-cam has 4 available gpio pins (there are 2 more pins but one is used by SD card and one is connected to built-in flash) plus 2 uart pins. With narrow angle camera it costs around $6. Wide angle camera costs $4 or so. You need serial port to program it. There are some other limitations you'll only find when you start playing with it like DAC not working when wifi is on. So theoretically you can control 6 LEDs directly. On one 18650 battery it lasts 2 hours.
--------------
| SDCARD |
5V -|1 16|- 3V3
GND -|2 CAMERA 15|- GPIO_16 (useless, can't be used for anything)
A GPIO_12 -|3 14|- GPIO_0, connect to GND during programming, used by camera, don't use!
A GPIO_13 -|4 13|- GND
A GPIO_15 -|5 12|- 3V3/5V
A GPIO_14 -|6 11|- UART RX, GPIO_3
A GPIO_2** -|7 10|- UART TX, GPIO_1
A GPIO_4* -|8 9|- GND (weird, don't use)
| LED |
--------------
- A=analog input 0..4096
- GPIO_4 is connected to FLASH LED, if you want to use as input you need to desolder resistor R13 that goes to base of npn transistor
- GPIO_2 is HS2_DATA0 for SD card, it has 47k pullup
- GPIO_4 is connected to FLASH LED, if you want to use as input you need to desolder resistor R13 that goes to base of npn transistor
- GPIO_2 is HS2_DATA0 for SD card, it has 47k pullup