I am trying to interface my laptop with the camera (MAPIR survey 2). I am sending a signal (serially) from the laptop (using matlab) so that Arduino will generate a 2ms PWM pulse of 3.3 volts. The camera only takes pictures when the pulse is between 1.8 to 2 ms. I used analogWrite function to creat this pulse but in my oscilloscope, I am observing a 5 volts pulse with approximately 5ms width even though I have given a delay of 2ms before setting the PWM pin to low.
Also, since I need only one pulse per picture, I wanted to know if I need to calculate duty cycle (because every topic related to PWM had a small discussion on duty cycle).
A brief description on the sketch:
The sketch I have attached has both a button as an interrupt for triggering the camera and a command waiting for a signal from USB to click pictures 3 times. the waiting period between two triggers is 3 seconds as per the camera specification.
test3.ino (2.33 KB)