I'll turn my comment into an answer ... :)
Okay so to create a program from Simulink you'll need code generation tools installed. ver
will tell you if you have Simulink Coder, and optionally Embedded Coder. If you're using an older version of MATLAB then it's called Real-time Workshop. Without one of those you're not going to be code-generating anything.
So assuming you can code-generate:
S-functions are they way to go: http://www.mathworks.co.uk/help/simulink/s-function-basics.html
... although there are various tools to assist with creating S-functions.
In short, the process is:
- Take a copy of the sfunc_basic.c (or something like that) S-function C file template and populate accordingly. This is not trivial by any means, it can take quite a while to get it to compile (see below) and not crash MATLAB when it gets instantiated in a model.
- Compile with mex command (see the documentation).
- Use block in model. Create yourself a test harness model that does something very simple. Use the minimum model blocks necessary to create a working solution.
- Create a TLC file which will define how to use block data at compile and run time in the model C program. In here you will be making calls to the liquidcrystal library.
- Code generate / fix errors with TLC and or S-function / fix errors in generated code / repeat until complete :)
All of those steps can be expanded on a lot. The process is a bit of a haul the first time, but you'll learn a lot about S-functions, the model.RTW file, TLC and debugging all of the above.
Oh yes, debugging the S-function can be a ball-acher. Be prepared to use something like visual studio to "attach" to the matlab process to debug it.
Rich
ver
command to get a list of toolboxes that you have available. That may greatly influence how you approach this problem. – Continual