I've now got the Teensy firmware code to a point where the MIDI controller is working as intended and fully usable for controlling the Turnado software.
All software can be seen in the project's GitHub repository, and rather than trying to describe here how the software implementation works I've commented the code as much as possible to try and explain this.
The code I have written for this project is split over 13 files, where the Arduino/Teensy sketch code is split over 7 files (the .ino file and 6 .h files), with three classes (each split over a .h and .cpp file) that are used in the sketch.
These are the code files that make up the project's Teensy/Arduino project:
- TurnadoController.ino - The Teensy/Arduino sketch file. This file doesn't include much code other than includes to the sketches .h file, call's to 'setup' and 'update' functions within the .h files, and some global variables.
- Globals.h - This file includes global defines that are needed by many of the other files.
- PinAllocation.h - This file includes defines for the Teensy pin allocations for the project.
- Controls.h - This file includes all code relating to reading and processing the devices controls. This is one of the largest code files of the project.
- Lcd.h - This file includes all code related to the setup of and drawing on the LCD. This is another one of the largest code files of the project.
- MidiIO.h - This file includes all the code relating to MIDI input and output.
- Settings.h - This file includes all code relating to the device settings and reading from and writing to EEPROM.
- RotaryEncoder.h / RotaryEncoder.cpp - This class handles the processing of rotary encoder controls.
- SwitchControl.h / SwitchControl.cpp - This class handles the processing of push buttons / switches.
- ThumbJoystick.h / ThumbJoystick.cpp - This class handles the processing of thumb joysticks (current only Y axis, and X axis and switches aren't used in this project).