HackUTOKYOv2Pim

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

commit 0bc879ec277e3209f92c2a3838f0fbdbc8c6284f
parent f70bbece70beb9673c72abf6c597520f3546f84e
Author: 諒太 林 <ryouturn@gmail.com>
Date:   Fri, 30 Aug 2024 21:06:34 +0900

update main

Diffstat:
Mhacku-tokyo-v2-pim.py | 22+++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/hacku-tokyo-v2-pim.py b/hacku-tokyo-v2-pim.py @@ -23,6 +23,7 @@ GPIO.setup(stepPin, GPIO.OUT) # 4:Step def main(): GPIO.output(enabPin, 0) + while(True): ret, frame = cap.read() @@ -30,22 +31,21 @@ def main(): mos = mosaic(gray) count = dump(gray, keep) + print(count) + if count[0] >= camLimit: - if count[1] < camLimit: - escapeR - elif count[0] > count[1]: - escapeR + if count[0] > count[1]: + print("R>L") + escapeR() else: - escapeL + print("R<L") + escapeL() elif count[1] >= camLimit: - escapeL - - cv2.imshow('frame',frame) - cv2.imshow('mos',mos) - + escapeL() + if cv2.waitKey(1) != -1: break - + GPIO.cleanup() #逆かもしれない