Here's how to use Code::Blocks to create a simple teensyduino (Teensy 3.0 or 3.1) project.
Prerequisites:
Shortcut:
Zipped project template with instructions in the project notes: View attachment cb_teensyduino_120_simple.zip
The zipped project differs a bit from the tutorial below. The zipped project doesn't have debug and release targets (because we can't use a hardware debugger on the teensy), but targets for teensy 3.0 and teensy 3.1 instead.
Setting up a teensyduino project in Code::Blocks is not easy, but I'll try to make this as simple to understand and follow as possible. The good news is that you can create a project template after you have created this project, and reuse it. Then it's quick and easy!
Now we have the files and compiler set up, but Code::Blocks doesn't know what compiler flags to set, where include files should be searched for, and so on. These will be covered in the next post.
Prerequisites:
- A working teensyduino installation
- A working Code::Blocks installation
- A configured teensyduino arm-gcc in Code::Blocks
Shortcut:
Zipped project template with instructions in the project notes: View attachment cb_teensyduino_120_simple.zip
The zipped project differs a bit from the tutorial below. The zipped project doesn't have debug and release targets (because we can't use a hardware debugger on the teensy), but targets for teensy 3.0 and teensy 3.1 instead.
Setting up a teensyduino project in Code::Blocks is not easy, but I'll try to make this as simple to understand and follow as possible. The good news is that you can create a project template after you have created this project, and reuse it. Then it's quick and easy!
- In the welcome screen click on "Create a new project" (or use File->New->Project...) to open the project wizard:
- Select "Console Application" and click on "Go":
- Select "C++":
- Pick a project name and base folder:
- Select your teensyduino arm gcc compiler. If you haven't configured it yet, abort and do that now (how?). It's also possible to change the compiler later, but beginners might run into problems with that.
If Code::Blocks complains that it doesn't know how to set exception flags for this compiler: That's ok, we'll do that later.
- You should see an almost empty project now. It's time to add the teensyduino core sources. Right-click the project root and click on "Add files recursively":
Select the teensyduino core base folder (<arduino root directory>/hardware/teensy/cores/teensy3):
You can leave everything as it is and add the files to both targets (Debug and Release):
Now we have the files and compiler set up, but Code::Blocks doesn't know what compiler flags to set, where include files should be searched for, and so on. These will be covered in the next post.
Last edited: