10.b. Compiling an Example App
After you have installed all the necessary software (either from the Wixel Development Bundle or from other sources), you should try compiling an example app and loading it onto a Wixel to make sure that your system is set up correctly.
Go to the folder where you installed the Wixel SDK (
C:\wixel-sdk is the default) and run
make_all.bat. If everything is installed correctly, the output of that batch file should look something like this:
You have now built all the apps in the Wixel SDK and all the libraries that they depend on. Every subfolder of the
apps folder should now have a WXL file in it. This is a compiled app which can be loaded onto Wixels using the Wixel Configuration Utility or the Wixel Command-Line Utility (WixelCmd).
You might get the following error message from make in Windows:
make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x425073)
If you get this error, please run “make -v” at a Command Prompt and make sure that you are running GNU Make 3.82-pololu2. This version of make is included in the latest Wixel Development Bundle (see Section 10.a). If the output from “make -v” shows some other version of make even after installing the Wixel Development Bundle, then you should remove that other version of make from your PATH or reorder your PATH so that version 3.82-pololu2 is used. You can edit your PATH environment variable from the Control Panel. See the pololu/make wiki on GitHub for more information on this problem.
Loading an App onto Wixels from the Command Line
While you are developing an app, it can be useful to have a way to load an app onto the target Wixel from the command line. You can do this with the Makefile: plug a Wixel into your computer, open up a command prompt, navigate to the
wixel-sdk folder, and type
make load_example_blink_led. This should compile the
example_blink_led app (if it is out of date) and then invoke the Wixel Command-Line Utility (WixelCmd) in order to load the app onto all Wixels connected to your computer. The output should look something like this:
The example blink LED application should be running now. The Wixel’s yellow LED should be off, and the red LED should be blinking. If that is the case, then congratulations! You have successfully compiled a program and loaded it onto the Wixel.
You can also specify settings at the command line. Try running this command:
make load_example_blink_led S="blink_period_ms=100"
You should now see the LED blinking 5 times faster than it was before. To specify multiple settings, put other settings inside the quotes and separate all settings with spaces.
Opening an App with the Wixel Configuration Utility
You can also open the app in the Wixel Configuration Utility if you want to. Try running this command:
The Wixel Configuration Utility should start running and open the example_blink_led app.
Creating Your Own Apps
Now that you know how to compile apps and quickly load them onto the Wixel to test them, you are ready to develop your own Wixel apps. You can either modify one of the existing apps in the SDK or create your own app. To create your own app, simply copy one of the existing app folders and change the name. You do not need to modify the Makefile when you create a new app; the Makefile will automatically detect the app as long as it is in the apps folder. When you are developing your app, you can use all of the commands above except you should replace “example_blink_led” with the name of your app (the name of the subfolder in the apps folder). For more information, including documentation of all the libraries in the Wixel SDK, see the Wixel SDK Documentation.