add bin position script, update neopixel code
This commit is contained in:
parent
190dc73036
commit
47eb71057f
BIN
GPUCache/data_0
Normal file
BIN
GPUCache/data_0
Normal file
Binary file not shown.
BIN
GPUCache/data_1
Normal file
BIN
GPUCache/data_1
Normal file
Binary file not shown.
BIN
GPUCache/data_2
Normal file
BIN
GPUCache/data_2
Normal file
Binary file not shown.
BIN
GPUCache/data_3
Normal file
BIN
GPUCache/data_3
Normal file
Binary file not shown.
BIN
GPUCache/index
Normal file
BIN
GPUCache/index
Normal file
Binary file not shown.
BIN
Item Sorter_screenshot_08.01.2020-1.png
Normal file
BIN
Item Sorter_screenshot_08.01.2020-1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 809 KiB |
BIN
Item Sorter_screenshot_08.01.2020-2.png
Normal file
BIN
Item Sorter_screenshot_08.01.2020-2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
BIN
Item Sorter_screenshot_08.01.2020-3.png
Normal file
BIN
Item Sorter_screenshot_08.01.2020-3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 824 KiB |
10
control_motor.py
Normal file
10
control_motor.py
Normal file
@ -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
|
12
pixel.py
12
pixel.py
@ -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))
|
|
7
pixel_control.py
Normal file
7
pixel_control.py
Normal file
@ -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))
|
3
run_detect.py
Normal file → Executable file
3
run_detect.py
Normal file → Executable file
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user