Arduino code for senior thesis project (written in C for the Arduino Uno)