Hi! I want to learn how to program the keyboardio so I can customize it myself and I thought it might be nice to learn the programming language while I wait for it. Any advice for starters?
Learning to be competent in C++ might be overkill, unless you also just want to acquire a valuable skill. You might try just messing around with the code before receiving your keyboard. If you haven’t changed much and the code compiles still, it might be right. I worked out my layout a month before I got mine.
But aside from the needs of skill in C++ in the firmware, it’s also a great thing to learn, anyway. That, and you really will need at least some understanding when you inevitably run into compilation errors. I recommend Bjarne Stroustrup’s A Tour of C++. He’s actually the guy who originally invented the language, and he’s still very active in the community and standards board. This book is better than many you’ll find, because a lot of them don’t teach best practices. It’s also a lot thinner than his authoritative The C++ Programming Language.
Finally, keep in mind that the Arduino implementation of C++ has a couple differences. There’s a good discussion about that in this thread.
Thanks! I really appreciate it!
I second @atimholt’s recommendation for A Tour of C++, especially if you already know some other C-ish language. The book provides a great, concise introduction to C++ without spoon-feeding general programming concepts (exactly what I was looking for). I started with zero C++—and still have much to learn—but skimming the first few chapters clarified enough of the C++-specific syntax to enable me to understand and work with the Kaleidoscope/plugin source code productively. It won’t be the best resource for someone who never wrote any code before, though.
As Tim said, a deep understanding of the language isn’t needed for an end-user to customize his or her keyboard. The project and contributors did a great job in this regard.
You may also want to familiarize yourself with the tooling used to build and upload the firmware. From what I’ve seen so far, Kaledioscope currently supports two official workflows:
- Compile and upload the firmware using the Arduino IDE (GUI approach)
- Compile and upload using the custom kaleidoscope-builder build system (command-line approach)
The second workflow expects a bit of git knowledge and some understanding of shell environments. Kaleidoscope’s wiki provides introductory guides for both.
Stroustrup’s and Cline’s C++ FAQ might be useful to resolve specific questions, e.g. while working with and understanding existing code.
So I mainly wanted to be able to program the keyboard and it was a lot simpler than I expected! I’m ecstatic with how fast I’m picking it up!