Skip to content

Commit 67b56b6

Browse files
edward-arduArduCAM
authored andcommitted
Create trigger.py
1 parent ac98b02 commit 67b56b6

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Arducam External trigger signal generator.
2+
# Copyright (C) 2022, Arducam.
3+
4+
# External module imports
5+
import RPi.GPIO as GPIO
6+
import time
7+
8+
# Pin Definitons:
9+
ledPin = 2 # Broadcom pin 2
10+
# Pin Setup:
11+
GPIO.setmode(GPIO.BCM) # Broadcom pin-numbering scheme
12+
GPIO.setup(ledPin, GPIO.OUT) # LED pin set as output
13+
14+
# Initial state for LEDs:
15+
GPIO.output(ledPin, GPIO.LOW)
16+
17+
print("Start Trigger! Press CTRL+C to exit")
18+
try:
19+
while 1:
20+
GPIO.output(ledPin, GPIO.HIGH)
21+
time.sleep(0.001)
22+
GPIO.output(ledPin, GPIO.LOW)
23+
time.sleep(0.032)
24+
except KeyboardInterrupt: # If CTRL+C is pressed, exit cleanly:
25+
GPIO.cleanup() # cleanup all GPIO

0 commit comments

Comments
 (0)