I am using an adafruit M4 express Cortex M4 core running at 120 MHz, 512 KB flash, 192 KB RAM
For now I want to use the m7 as a camera that can take a picture on demand from an arduino serial port.
Is it possible and do you know of any sample code for both arduino & openmv to
- Request (from the arduino) the openmv to take a picture (This is cleaner in my case than using an external pin trigger)
- Receive from the openmv a picture (binary data is fine, once the arduino receives it will be posted to a server)
Yes you’ll find so many examples for this if you search the forums:
They don’t do exactly what you want to do, but you can put something together form the examples and then let me know if you need more help.
Hi, I can’t really give you all the code you need but I can point you to the right direction.
import pyb, sensor, image
uart = pyb.UART(3, 115200, timeout_char=1000)
if uart.read(1) == 'p':
img = sensor.snapshot().compress(quality=80)
When the camera receives ‘p’ on the uart it will send the jpeg stream.
As for the Arduino size of things, the first 4 bytes are the image size followed by the jpeg data which you want to write to disk. The data is kinda going to come back to back… so, you need to be able to handle the burst speed.
This is great. Thank you both for the fast replies!