import grovepi
import time

LED = 2  # Digital port D2
grovepi.pinMode(LED, "OUTPUT")

def on():
   grovepi.digitalWrite(LED, 1)


def off():
   grovepi.digitalWrite(LED, 0)

if __name__ == "__main__":
    on()
    time.sleep(1)
    off()