Device Configuration
In order to use all the nifty hardware that provides Inputs and/or Outputs, LCPF needs to know what hardware you are using. This is usually a fairly complex part of an embedded project. LCPF makes this much easier1. For example, if you use a Lolin S2 Mini  with a Terrain-Tronics Caernarfon Castle Kit , IR remote, 35 NeoPixel LEDS, and two servo motors, your entire code for device configuration could be as simple as
caernarfon = mainManager.TerrainTronics.addCaernarfon(neoPixelCount=35)
doorMotor = caernarfon.initServo( 1, "doorDrive" )
windowMotor = caernarfon.initServo( 2, "windowMotor" )
remote = caernarfon.addIrRemote()
No pins assignments, no addresses, no board types - LCPF handles all that for you.1 For example, if you use a Lolin S2 Mini  with a Terrain-Tronics Caernarfon Castle Kit , configuration is as simple as
caernarfon = mainManager.TerrainTronics.addCaernarfon()
There’s no need to specify what kind of controller you’re running on 2 - LCPF figures that out for you. And since it knows where the various parts of the Caernarfon Castle board are connected, there’s no need to specify pin assignments. So if you are using the IR remote, 35 NeoPixel LEDS, and two servo motors, your entire code for device configuration could be
caernarfon = mainManager.TerrainTronics.addCaernarfon(neoPixelCount=35)
doorMotor = caernarfon.initServo( 1, "doorDrive" )
windowMotor = caernarfon.initServo( 2, "windowMotor" )
remote = caernarfon.addIrRemote()
Supported Controllers
Board | Chip | Ram | Flash | Features |
---|---|---|---|---|
Lolin S2 Mini  | ESP32-S2 | 2MB | 4MB | D1MPC3 |
Lolin S3 Mini  | ESP32-S3 | 2MB | 4MB | D1MPC3 |
Lilygo T-OI+  | ESP32-C3 | 400K | 4MB | D1MPC3, battery |
Supported Terrain-Tronics D1 shields
(these require a D1MPC 3 controller )
- Cilgerran Castle  6x High Power LED and DC Motor driver
- Harlech Castle  Smart 8xLED Controller
- Caernarfon Castle  NeoPixel, IR, Qwiic/StemmaQT, triple servo
Supported upcoming Terrain-Tronics products
- Caerphilly Castle Carrier board with NeoPixel, IR, Qwiic/StemmaQT
- Harlech Castle XL - I2C (Qwiic/StemmaQT) 24 LED controller
Supported StemmaQT / Qwiic boards
Adafruit
- AW9523
- TLV493D
- MPR121
- Wii Nunchuk
- PCA9685
- QtRotaryEncoder
- VL53L0X
Generic I2C
- SSD1306 OLED display
Footnotes
-
IF you stick within the “curated” set of hardware options. However, there are already a few dozen supported devices and the list continues to grow. ↩ ↩2
-
Currently supported controllers include Lolin S2 Mini, Lolin S3 Mini, and the Lilygo T-OI Plus ↩
-
D1MPC = D1 Mini Pin Compatible, accepts Wemos Mini shields (like Terrain-Tronics Castle boards) ↩ ↩2 ↩3 ↩4