add bin position script, update neopixel code

video
Cole Deck 5 years ago
parent 190dc73036
commit 47eb71057f

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 809 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 KiB

@ -0,0 +1,10 @@
import math
def goToBin(bin):
if bin % 2 == 0:
direction = "right"
else:
direction = "left"
adjustedBin = math.floor(bin / 2)
distance = adjustedBin * 18
time = 0.5 + 0.93 * adjustedBin

5055
cv2

File diff suppressed because it is too large Load Diff

@ -1,8 +1,6 @@
import time import time
import board import pixel_control
import neopixel pixel_control.ledOn()
pixels = neopixel.NeoPixel(board.D18, 24) time.sleep(10)
def ledoff(): pixel_control.ledOff()
pixels.fill((0,0,0)) pixel_control.ledOff()
def ledon():
pixels.fill((255,255,235))

@ -0,0 +1,7 @@
import board
import neopixel
pixels = neopixel.NeoPixel(board.D18, 24)
def ledOff():
pixels.fill((0,0,0))
def ledOn():
pixels.fill((180,200,180))

@ -1,3 +1,4 @@
#!/usr/bin/python
import detect import detect
import sort import sort
import timeit import timeit
@ -7,7 +8,7 @@ calibration_width = 0.75
image = "img7.jpg" image = "img7.jpg"
images = ("img2.jpg", "img3.jpg", "img4.jpg", "img5.jpg", "img6.jpg", "img7.jpg", "img8.jpg") images = ("img2.jpg", "img3.jpg", "img4.jpg", "img5.jpg", "img6.jpg", "img7.jpg", "img8.jpg")
#images = ("img.jpg", "img2.jpg") #images = ("img.jpg", "img2.jpg")
video = False video = True
def go(): def go():
for file in images: for file in images:
items,output = detect.detect(calibration_width, file, True, False) items,output = detect.detect(calibration_width, file, True, False)

153732
sort

File diff suppressed because it is too large Load Diff

1068
timeit

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save