Hiding details
Hardware details
Many people who are intimidated by the thought of writing code are also likely to see picking up a soldering iron or cross referencing documentation for various bits of embedded kit to map between logical and physical assignments as something they’d rather avoid.
The LCPF attempts to adress both of these concerns, by providing a list of “curated” hardware options which are available off the shelf and require very little if any soldering - just “plug and play”. In order to do so, the LCPF heavily leverages ShieldStandards like the D1Mini and Adafruit Feather form factors, and standardized cable systems for addon Devices like StemmaQTQwiic.
Through the use of factory patterns, in most cases all the user needs to do is declare what hardware they’re using. For example, carnarfon = main.TerrainTronics.addCarenarfon()
sets up a Terrain Tronics Caernarfon Castle D1Mini shield on whatever (D1Mini compatible) Controller the LCPF is running on and automatically configures all the pins and devices needed to use that shield.
Internally, the LCPF knows which controller it is running on. The user only has to specify which Shields and Devices (at least for StemmaQTQwiic boards) they want to use, and the framework will take care of the rest. If the user later decides to switch to a different controller (e.g. from a Lolin S2 Mini to a Lolin S3 Mini), as long as they both support the same ShieldStandard everything should still work without any changes to their project code (although they do have to install the framework and copy their project config over - “magic” only goes so far…)
The framework knows what pins are used for what on that shield, and prevents any conflicts (e.g. trying to use channels 7/8 on a Cilgerran Catle for both LEDs and a DC motor).
The user doesn’t need to know or care what pins are used for what, or even what controller they’re using (as long as it’s supported). If they later decide to switch to a different controller (e.g. from a Lolin S2 Mini to a Lolin S3 Mini), everything will still work without any changes to their project code (although they do have to install the framework and copy their project config over - “magic” only goes so far…)