[reprinted from PSoC Creator News and Information]
One of my favorite new features in PSoC Creator 4.0 is the ability to create and use templates for new projects. I used it extensively during my theater presentations at the Electronica trade show in Germany last week (which is why I did not manage to get a blog article out!).
In the presentation I made a robot car follow a line of electrical tape on the desk. The project used PWMs to drive the reflectance sensors and the motors. The two parts of the design were almost identical and so, in the best TV cooking show tradition, I pre-prepared the motor-driving part in order to save a little time and spare people the agony of watching me draw and type!
It is really easy to create a template. You simply make the design, then right-click on the project in the Workspace Explorer and pick the "Copy to My Templates" entry. Job done!
To use them open the New Project dialog as normal and in the "Select project template" step select "My Template project".
When you press Next you see a list of all the templates you have created. I have two versions for my robot presentation and one for my Pioneer 4200 kit.
When the new project is created it will include all the functional content from your selected template. Awesome sauce!
While the robot templates were great at the show I am using my Pioneer template all the time. It is the board I use most often and my template saves me adding the input pin for the switch, the output pins and PWMs for the LEDs, the CapSense, the I2C, and the UART to every single project I make. It is so much faster to delete the stuff you do not want than to add the stuff you usually need. Best of all, I never put the pins in the wrong place when I use the template. I even put commented-out startup code in main.c so I can quickly uncomment the lines that I need for typo-free firmware.
If you find that you use the same hardware for multiple projects or you have design elements that you reuse all the time then project templates could be of real benefit to you. Give them a try - it takes five seconds to create one and ten to use it in a new project. You may find that it saves you hours or days in your future development work!