Explorar o código

generiert Rechtecksignal

Felix Stange %!s(int64=3) %!d(string=hai) anos
pai
achega
ebec60098a
Modificáronse 1 ficheiros con 21 adicións e 0 borrados
  1. 21 0
      rt-tests/Pin-Test.py

+ 21 - 0
rt-tests/Pin-Test.py

@@ -0,0 +1,21 @@
+#!/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()