I have a project that needs arduino to control the webcam by having it snap a photo when the proximity sensor connected to the arduino has sensed an object within its range. however, I must use matlab to display the webcam's view and from there, an image will be created and saved. how can i use matlab and arduino to do this? thanks!
The Arduino can't do the image stream, way beyond its capabilities, but it can do detect the motion and send a command over serial to the PC that MatLab should take a snapshot
a high level artchitecture looks like:
PIR --> ARDUINO --> Serial --> MATLAB <-- WEBCAM
check - http://luckylarry.co.uk/arduino-projects/arduino-motion-triggered-camera/
I have already done the video streaming on matlab, i just want arduino to communicate with matlab by saying(not literally) "hey, I sensed something via the proximity sensor, i want you to capture it and save it"
google arduino pir example => How to use Pyroelectric ("Passive") Infrared Sensors (PIR) -
at the end is some Arduino code which is 99% your need.
To speed up the communication to Matlab I would:
- shorten the strings send over serial
- increase the baudrate to 115200 or the maximum Matlab supports.