Closed echo-lalia closed 4 weeks ago
FYI, this change is already being implemented in the experimental-multiplatform
branch.
Currently, I am using a few different techniques in an attempt to simplify multiplatform development, including:
And more to come, hopefully :)
In MicroHydra 1.0, the API for controlling the hardware is highly specific to the Cardputer. This means that, to create apps that work on multiple devices, you would need to completely rewrite large parts of the code for every single device.
In order for MicroHydra to support multiple platforms (such as the Cardputer II and the original Cardputer) simultaneously, the API for all of the built-in modules must be redesigned such that apps no longer need to specify exact Pins or other device-specific parameters in order to control things like the display, speaker, keyboard, etc.
For example, this:
Will not work on anything except the Cardputer.
MicroHydra can use device-specific modules to simplify this process, and make the display initialization code in each app would look like this: