Making an Actuator- or Sensor- Control System require a little bit of software. It is many ways of doing this, but I always tend to use a pre-tested design containing of 4 main parts:
Communication is always required as we either take instructions or send data/progress to another control unit. This is usually also the largest and most complex software component needed. Many designs will implement a communication protocol and the app as just an extension to this. Myself I use an Object Dictionary.
Object Dictionary is a generic database interfacing between multiple applications using the same data. In its simplest form it is nothing but an array between data communication and sensors/actuators mapping data. A more sophisticated feature often needed is data integrity. As communication is capable of writing partly data we need a mechanism to commit or rollback so that the application only see consistent data sets. Another feature is the capability for persistent storage on selected variables or straight forward database queries.
The various user modules are Actuator(s), Sensor(s) and various other modules either using or providing data.
The last bulk of code is the infrastructure with RTOS and utilities.
The main issue here is that this design only need a map of data in the object dictionary, the right modules added and it adapts to any actuator sensor design.