hi guys,
i detect code 128 type barcode with i need pin output singnal
plz help
See the examples menu and bars code detection example. Then see the gpio pin control examples.
1 Like
Sir
I see the examples but I don’t understand. how to get output from Pin1.
plz modified below example
https://pyimagesearch.com/2018/03/19/reading-barcodes-with-python-and-openmv/
plz help
Hi, I don’t know what you want. You seem to want us to writ ethe code for you. I will not do that.
blow code modified to barcode detection
import sensor, image, time
# Color Tracking Thresholds (L Min, L Max, A Min, A Max, B Min, B Max)
thresholds = [(30, 100, 15, 127, 15, 127)]
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time = 2000)
sensor.set_auto_gain(False) # must be turned off for color tracking
sensor.set_auto_whitebal(False) # must be turned off for color tracking
clock = time.clock()
# Only blobs that with more pixels than "pixel_threshold" and more area than "area_threshold" are
# returned by "find_blobs" below. Change "pixels_threshold" and "area_threshold" if you change the
# camera resolution. "merge=True" merges all overlapping blobs in the image.
pin1 = Pin('P1', Pin.OUT_PP, Pin.PULL_NONE)
while(True):
clock.tick()
img = sensor.snapshot()
blobs = img.find_blobs(thresholds, pixels_threshold=200, area_threshold=200, merge=True)
for b in blobs:
img.draw_rectangle(b.rect())
img.draw_cross(b.cx(), b.cy())
pin1.value(len(blobs) == 6)
print(clock.fps())