To write the code, we first required the code which is needed to use the mpr121 breakout board. We got the code from this website:
We then changed the code around so that it can incorporate our use of LEDs, the button and the shocker that we made. To see the changes to the code, visit this gitlab link:
The changes we made were done in the mpr121.ino file given to us through the bildr website. The red rows were our deletions and the green rows were what we added to the code to make it work how we wanted.