Main Content

Create Project and Libraries Folder

Ensure to

The standard folder structure for a device driver block contains a System object™ and source and include folders.

Create a device driver project folder using the codertarget.createDriverProject function.


Check that these files and folders show in the device driver folder.

  • An include folder, include, for the C/C++ header files and additional libraries

  • A source folder, src, for the C/C++ source code

  • A template System object for sink blocks, Sink.m

  • A template System object for source blocks, Source.m

Add a new folder, libraries, in the colorSensor folder, and add the downloaded TCS34725 color sensor library files to this folder.

Right-click the colorSensor folder and select Add to Path > Selected Folders.

folder structure for custom device driver example

In the next section, you will Write Hardware Specific C/C++ Code.