Further refinement of BeagleBone code. Now tested on both black edition and white edition.