From 67b56b6cfd72092950b364a19bc99758c899dd26 Mon Sep 17 00:00:00 2001 From: edward-ardu <113565969+edward-ardu@users.noreply.github.com> Date: Thu, 15 Sep 2022 19:28:24 +0800 Subject: [PATCH] Create trigger.py --- Jetson/Jetvariety/external_trigger/trigger.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Jetson/Jetvariety/external_trigger/trigger.py diff --git a/Jetson/Jetvariety/external_trigger/trigger.py b/Jetson/Jetvariety/external_trigger/trigger.py new file mode 100644 index 0000000..d67586a --- /dev/null +++ b/Jetson/Jetvariety/external_trigger/trigger.py @@ -0,0 +1,25 @@ +# Arducam External trigger signal generator. +# Copyright (C) 2022, Arducam. + +# External module imports +import RPi.GPIO as GPIO +import time + +# Pin Definitons: +ledPin = 2 # Broadcom pin 2 +# Pin Setup: +GPIO.setmode(GPIO.BCM) # Broadcom pin-numbering scheme +GPIO.setup(ledPin, GPIO.OUT) # LED pin set as output + +# Initial state for LEDs: +GPIO.output(ledPin, GPIO.LOW) + +print("Start Trigger! Press CTRL+C to exit") +try: + while 1: + GPIO.output(ledPin, GPIO.HIGH) + time.sleep(0.001) + GPIO.output(ledPin, GPIO.LOW) + time.sleep(0.032) +except KeyboardInterrupt: # If CTRL+C is pressed, exit cleanly: + GPIO.cleanup() # cleanup all GPIO