What are scripted drivers
As stated scripted drivers are created with javascript and are inserted in the PiDome drivers ecosystem. Normally the setup is like this:
Hardware driver (like for serial connections) -> Software driver -> Devices on the server.
With scripted drivers these scripts are inserted into the Software driver. They take over the part where the translation takes place between the hardware and devices. This creates the following path:
Hardware driver ->Software driver -> (script) -> Software driver-> Devices on the server.
The scripts get access to methods inside the driver which are normally also used when these drivers are created in java, but then in the Javascript way.
API
We have tried to keep the API as simple as possible. To get started with the basics there are just four minimal needed functions already present in the script, and a couple of other predefined functions to send data to your hardware or update the device visuals.
There are also some tools present to be able to debug and log events. Below is a short clip showing an example which will be discussed in this blog post. the API will not be described in this blog post as it is alreaddy extensively done within the editor