Introduction

So you want to write a driver?

So did I and I didn’t have a clue. I opened the Driver Works Getting Started PDF, looked at the contents and decided I didn’t want to read it.

I just wanted to do something quickly and having to learn first wasn’t appealing. Wanting to take a shortcut I googled about, but having wasted an hour I didn’t find anything.

Then I found a driver someone had written, maybe I didn’t need to write a driver, that would be good. I tried to buy it – but the company who wrote it didn’t return my email or my registration request to buy the driver. Maybe because I’m not a dealer, maybe they didn’t like me either way they don’t seem to be in business to make money.

So I was back to having to learn to write a driver myself. Like everything, once you get started it becomes easier, but unfortunately the initial learning curve seemed to be steep with no basic info. So I thought I’d document the process for next time (I’m pretty forgetful), but also because maybe it will help someone else out.

What do you need to get going?

You can do everything to write a driver with a text editor, and then upload it using Composer. However Control 4 provide a text editor with macros to automate adding a lot of the standard stuff. Its called Driver Editor, and it makes life a lot easier. For example  if you get formatting wrong, then your driver won’t work. Driver Editor provides simple input boxes to create the XML needed so you don’t need to write it yourself and can avoid these errors.

Once you have Driver Editor, you just need Composer and a Home Controller and you are ready to go.

Example Code and Drivers

All the driver files and code examples are located on github at https://github.com/c4drivers/tutorial

Leave a comment