Download the relevant code from the link below.
SunFounder Ultimate Sensor Kit Code
Or check out the code at SunFounder Ultimate Sensor Kit - GitHub