Hi, so I’m fairly new to this OpenMV thing, and I need some help with communicating the OpenMV cam with an Arduino via UART. I’m working on a football robot that uses all sorts of sensors including the camera sensor. I’ve made a code that recognises the colour blue and yellow since that’s the colour of the goals. Can anybody help me with how to send the data from the camera to an Arduino?
import sensor, image, time
thresholds = [(44, 65, -23, -5, -43, -2),# Thresholds for blue
(50, 68, -9, 7, 50, 63)]# Thresholds for yellow
x_data=0
y_data=0
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time = 2000)
clock = time.clock()
while(True):
clock.tick()
img = sensor.snapshot()
for blob in img.find_blobs(thresholds, pixels_threshold=200, area_threshold=200):
img.draw_rectangle(blob.rect())
img.draw_cross(blob.cx(), blob.cy())
x_data=blob.cx()
y_data=blob.cy()
print("fps=%d" % clock.fps()),
print(" x=%d" % x_data),
print(" y=%d" % y_data)