send person_detection result to arduino error

I try to Combine the example tf_person detection and spi to send the result to arduino but i always show the error message(valueerror: extinct vector 12 is already in use)
i dont know how to fix the problem ,CUZ this is my first time use Micropython plz help me
this is the ERROR img :Screenshot-1 — ImgBB
and my code :
import sensor, image, time, os, tf, pyb, ustruct, array
sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE)
sensor.set_framesize(sensor.QVGA)
sensor.set_windowing((240, 240))
sensor.skip_frames(time=2000)

def nss_callback(line):
global spi, data
try:
spi.send(data, timeout=1000)
except OSError as err:
pass

A=[0]*1
net = tf.load(‘person_detection’)
labels = [‘unsure’, ‘person’, ‘no_person’]
text=str(A[0])
clock = time.clock()
while(True):
clock.tick()

img = sensor.snapshot()
for obj in net.classify(img, min_scale=1.0, scale_mul=0.5, x_overlap=0.0, y_overlap=0.0):
A[0]=str(int(obj.output()[1]))
data = ustruct.pack(“<bi%ds” % len(text), 85, len(text), text)
spi = pyb.SPI(2, pyb.SPI.SLAVE, polarity=0, phase=0)
pyb.ExtInt(pyb.Pin(“P3”), pyb.ExtInt.IRQ_FALLING, pyb.Pin.PULL_UP, nss_callback)

print(“**********\nDetections at [x=%d,y=%d,w=%d,h=%d]” % obj.rect())
for i in range(len(obj.output())):
print(“%s = %f” % (labels_, obj.output()))
img.draw_rectangle(obj.rect())
img.draw_string(obj.x()+3, obj.y()-1, labels[obj.output().index(max(obj.output()))], mono_space = False)
print(A[0],clock.fps(), “fps”)_

Use our interface library. We just released on for the Arduino. It literally comes with example code for this.

but i use the the example code than i can send message to arduino
so i want to know may i just combine this two example code ? cuz my coding and english ability are very weak so i want fix the problem more simpler so i can understane

Install the openmv rpc library on Arduino. Open up the examples, see the popular features example, follow the instructions in the example. Run the corresponding script on the OpenMV Cam, and things will work. You don’t have to do any coding.

this is my new error: Screenshot-2 — ImgBB
i didnt find same error on google

Mmm, what architecture are you using? I’ve tested compile for the AVR and ARM Cortex M3 (Arduino offical boards)

Are you using the ESP32? If so, you might need to ifdef out some of the interfaces in the library. You can just remove those interfaces. Both the class in the header and in the source file.

i using esp8266 wemos d1 r1:Screenshot-3 — ImgBB
so…i should remove some code in openmv rpc library?
and this my code: Screenshot-4 — ImgBB
did i delete something important?

Hi, I’ll update the library tomorrow morning and test compile with the ESP8266 and ESP32.

I have to add some ifdefs.

I’ll let you know when I’m done.

Okay, I pushed a released. Arduino will pick it up in about 2 hours: Releases · openmv/openmv-arduino-rpc · GitHub

THX bro you are a good guy

i want to know
Is there a way i can use example without use usb to connect computer and camh7 ?

Yes,

Tools->Save Script to OpenMV Cam

i mean everytime before i using my arduino i need to open the openmv and click start button
i want to know can i make my cam just use the usb give the power and the program will Start automatically ?

Yes,

Tools->Save Script to OpenMV Cam
Tools->Reset OpenMV Cam

When you connect to the camera with the IDE it stops whatever script is running.