just use only the camera. you dont need arduino for that!
There are almost 10 pins for i/o .
How many pins you will use in the arduino?
i built a robot. there is a motor driver for four motor. When the camera detect a color the motors should be stop. It is not possible to connect the motor driver to the openmv cam
if you cant with openmv cam you cant connect the motor to arduino also.
i can control the motors with arduino
Can you show us those drivers that you control with Arduino? How you control them?
Anyway if you insist on Arduino did you try to communicate via the digital pins? If you have 3 free pins in Arduino you can have 8 conditions . Connect them to 3 output pins of the camera and send 000 for red, 001 for green, 010 for blue and so on … It’s really faster
Can you send a program?
My cam has more than 3 empty pins.
you can do it yourself!
please check 6.1.2. GPIO Control — MicroPython 1.19 documentation.
you can control the pins regarding your inspection!
its really easy!
thank you, i will try it.
# Basic UART communications between OpenMV and Arduino Uno.
# 1) Wire up your OpenMV Cam to your Arduino Uno like this:
#
# OpenMV Cam Ground Pin ----> Arduino Ground
# OpenMV Cam UART3_TX(P4) ----> Arduino Uno UART_RX(0)
# OpenMV Cam UART3_RX(P5) ----> Arduino Uno UART_TX(1)
# 2) Uncomment and upload the following sketch to Arduino:
#
# void setup() {
# // put your setup code here, to run once:
# Serial.begin(19200);
# }
#
# void loop() {
# // put your main code here, to run repeatedly:
# if (Serial.available()) {
# // Read the most recent byte
# byte byteRead = Serial.read();
# // ECHO the value that was read
# Serial.write(byteRead);
# }
# }
# 3) Run the following script in OpenMV IDE:
import time
from pyb import UART
# UART 3, and baudrate.
uart = UART(3, 19200)
while(True):
uart.write("Hello World!\n")
if (uart.any()):
print(uart.read())
time.sleep_ms(1000)
I would like to use this program between openmv cam h7 and arduino. Can you help me how can i make a conditions in the arduino code for the uart communication send?
dear friend.
please dont wait for a response from arduino.
Simple use uart write when you want to write something on port3 hardware serial.
Then in arduino loop check if something is on hardware serial and then apply on your code.
Dont mess with response unless you get familiar with serial communication.
Please read first and then ask.
You are student and this has to be done by your own!
Yes, but i ordered a 100$ camera and i would like to understand how it works .
I’m asking here because I couldn’t find such a project on the internet
ok! so now you know !
good luck with your project!
Out of curiosity, What are those motor drivers that you can control them with arduino and not with the cam?
TB6612FNG motor driver
So you use 3 pins for a motor and you want 12 pins to control all 4 motors?
yes, 12 pins
Ok so.
I would try to send the desire data with uart.writechar.
Then read the data on Arduino .
can you send an exmaple program pls?
Forget openmv. Are you able to read any serial data with Arduino via pins tx,Rx?
The camera will write data everytime you call uart.writechar. use those pins on Arduino to read them.
yes, i can. I use uart.write in the openmv ide. The arduino receive that write but i cannot make a condition
So you manage to read data but not to make an if condition to compare those data?
Did you try with uart.writechar?
Did you print the received data to the serial monitor to see what Arduino read?
What do you see there?
i did not try the uart.writechar yet. Yes, arduino print the received data to the serial monitor. I saw HelloWorld! that I write to send in the openmv ide
It is enough to send numbers (1,2,3…) for me. But I would like to make conditions with it.