NickApparently
New member
Hey All!
I'm programming a Teensy 4.0 for my Drum Pad. The thing runs fine, but I feel that the software could be improved a lot. I'm a pretty decent programmer for industrial PLCs, but when it comes to Arduino code I'm pretty novice.
I think the code could mainly be improved by using classes and objects, but since the most functions I use are pretty simple voids I never got around to really understand classes and objects. Now it feels like a big hurdle to change the code with classes and objects. Next to that, the code for the menu (and the display accordingly) are huge. I couldn't think of, or find, any simpler way to program the menu, but still feel like there should be a better way.
Quick rundown of the Drum Pad:
There are a total of 6 pads, 2 external inputs and 2 external foot-switch inputs.
Hits are detected by a FSR sensor. Next the velocity is measured by a piezo element. According to multiple settings a Midi command is sent.
Settings are changeable in the menu. An encoder and a 1602 LCD-display make it possible to navigate through the menu.
Settings are saved in one of 9 slots.
Performance wise, it would be great if the program wouldn't "pause" when writing to the LCD, but I'm not sure if thats possible.
Now my question is: Would anyone be so kind to look through my code and give me pointers on how to improve?
If anything needs to be explained, please let me know.
https://github.com/NickApparently/TeensyDrum/blob/main/src/TeensyDrum.ino
~
I'm programming a Teensy 4.0 for my Drum Pad. The thing runs fine, but I feel that the software could be improved a lot. I'm a pretty decent programmer for industrial PLCs, but when it comes to Arduino code I'm pretty novice.
I think the code could mainly be improved by using classes and objects, but since the most functions I use are pretty simple voids I never got around to really understand classes and objects. Now it feels like a big hurdle to change the code with classes and objects. Next to that, the code for the menu (and the display accordingly) are huge. I couldn't think of, or find, any simpler way to program the menu, but still feel like there should be a better way.
Quick rundown of the Drum Pad:
There are a total of 6 pads, 2 external inputs and 2 external foot-switch inputs.
Hits are detected by a FSR sensor. Next the velocity is measured by a piezo element. According to multiple settings a Midi command is sent.
Settings are changeable in the menu. An encoder and a 1602 LCD-display make it possible to navigate through the menu.
Settings are saved in one of 9 slots.
Performance wise, it would be great if the program wouldn't "pause" when writing to the LCD, but I'm not sure if thats possible.
Now my question is: Would anyone be so kind to look through my code and give me pointers on how to improve?
If anything needs to be explained, please let me know.
https://github.com/NickApparently/TeensyDrum/blob/main/src/TeensyDrum.ino
~