123456789101112131415161718192021 |
- #!/usr/bin/python
- # -*- coding: utf-8 -*-
- import time
- import RPi.GPIO as GPIO
- Output = 18 # GPIO24 = Pin 18
- GPIO.setmode(GPIO.BOARD)
- GPIO.setup(Output, GPIO.OUT)
- time.sleep(1)
- try:
- while(1):
- GPIO.output(Output, 1)
- GPIO.output(Output, 0)
- except KeyboardInterrupt:
- pass
- finally:
- GPIO.cleanup()
|