This mode is designed for configurations not using an External Clock Signal.You will utilize one camera in leader mode (outputting a synchronization signal) and all remaining cameras in follower mode.
Leader/Follower Firmware Guide
Click here to see our guide on updating your camera between Leader and Follower modes.
This mode is designed for configurations using an External Clock Signal to output the synchronization signal for all cameras.In this mode, all cameras must be set to follower mode.
Leader/Follower Firmware Guide
Click here to see our guide on updating your camera between Leader and Follower modes.
The Arduino Uno (ATmega328P) is currently the only confirmed working board for this configuration.
1
Download the PWM Library
Download the source code for the PWM library here: ArduinoPWM v1.0.0
2
Add the .ZIP Library
Import the downloaded .ZIP library into your Arduino IDE.
3
Upload the Sketch
Upload one of the two sketches below to your Arduino.
Simple Control: The quickest way to get started, but requires reflashing the firmware to adjust your FPS.
Serial Control: Allows you to adjust frequency and duty cycle in real-time without reflashing (settings will reset if the device loses power).
Simple Control
Serial Commands
#include <PWM.h>// Pin configurationint pin = 9; // Pinint value = 127; // Initial value for the PWM duty cycle// SET FREQUENCY HEREfloat frequency = 60; // Initial frequency in Hzvoid setup(){ // Initialize all timers except for timer0 to save timekeeping tasks InitTimersSafe(); // Set the initial PWM frequency and duty cycle if (SetPinFrequencySafe(pin, frequency)) { pwmWrite(pin, value); Serial.println("PWM frequency and initial duty cycle set."); } else { Serial.println("Failed to set frequency."); }}
#include <PWM.h>// Pin configurationint pin = 9; // Pinint value = 127; // Initial value for the PWM duty cyclefloat frequency = 60; // Initial frequency in Hzvoid setup(){ Serial.begin(9600); // Initialize all timers except for timer0 to save timekeeping tasks InitTimersSafe(); // Set the initial PWM frequency and duty cycle if (SetPinFrequencySafe(pin, frequency)) { pwmWrite(pin, value); Serial.println("PWM frequency and initial duty cycle set."); } else { Serial.println("Failed to set frequency."); }}void loop(){ if (Serial.available()) { // Read frequency and duty cycle values over Serial String inputString = Serial.readStringUntil('\n'); inputString.trim(); int freqDutySplitIndex = inputString.indexOf(','); if (freqDutySplitIndex != -1) { String freqStr = inputString.substring(0, freqDutySplitIndex); String dutyStr = inputString.substring(freqDutySplitIndex + 1); // Parse floats float newFrequency = freqStr.toFloat(); int newDutyCycle = dutyStr.toInt(); // Validate frequency range if (newFrequency >= 1 && newFrequency <= 2000000) { // Set the PWM frequency and apply duty cycle if (SetPinFrequencySafe(pin, newFrequency)) { value = map(constrain(newDutyCycle, 0, 100), 0, 100, 0, 255); pwmWrite(pin, value); Serial.print("Set frequency to: "); Serial.print(newFrequency); Serial.print(" Hz, duty cycle to: "); Serial.print(newDutyCycle); Serial.println("%"); } else { Serial.println("Failed to set new frequency."); } } else { Serial.println("Invalid frequency value."); } } else { Serial.println("Invalid input format. Use frequency,dutycycle (e.g., 60,50)."); } }}
This code allows you to modify the PWM signal on the fly. Open your serial monitor at 9600 baud and send commands using the format {FREQUENCY},{DUTY_CYCLE} (e.g., 60,50 for 60Hz at a 50% duty cycle).