Update SunnyBuddyPinTest.ino

Nested code into a function for easier code integration.