HackUTOKYOv2Pim

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 8725c65e4e4e4eaa0c45f52eecc00a2276ce4519
parent 9a523b8dcab255e3bd5806235bcd9db872f7dd81
Author: 諒太 林 <ryouturn@gmail.com>
Date:   Sat, 31 Aug 2024 08:28:54 +0900

add test 0 1

Diffstat:
Atest0.py | 43+++++++++++++++++++++++++++++++++++++++++++
Rtest.py -> test1.py | 0
2 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/test0.py b/test0.py @@ -0,0 +1,42 @@ +#!/usr/bin/python +# coding: utf-8 +import RPi.GPIO as GPIO +import time +import sys +import cv2 +import os + +stepPin = 22 +dircPin = 17 +enabPin = 23 + +camLimit = 5 + +#GPIO.setup(17, GPIO.OUT)#17:MS1 +#GPIO.setup(27, GPIO.OUT)#27:MS2 +#GPIO.setup(22, GPIO.OUT)#22:MS3 +GPIO.setmode(GPIO.BCM) # GPIOで指定 +GPIO.setup(enabPin, GPIO.OUT) # 2:Enableに定義 +GPIO.setup(dircPin, GPIO.OUT) # 3:Dir +GPIO.setup(stepPin, GPIO.OUT) # 4:Step + +def main(): + GPIO.output(enabPin, 0) + print("escapeR") + GPIO.output(dircPin, 0) + for num in range(0,1000): + GPIO.output(stepPin, 1) + time.sleep(0.001) + GPIO.output(stepPin, 0) + time.sleep(0.001) + time.sleep(1) + + +try: + main() +except KeyboardInterrupt: + print('interrupted!') + GPIO.cleanup() + +GPIO.cleanup() +cv2.destroyAllWindows()+ \ No newline at end of file diff --git a/test.py b/test1.py