○カメラのコントロール方法
制御端子(黄色)に300ms以下のパルス(アクティブLOW)入力で静止画撮影を、300ms以上のパルス入力で動画撮影を開始します。動画撮影は再度パルスを入れると停止します。
○回路図
○プログラム(スケッチ)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <FlexiTimer2.h> | |
const int camera_pin = 13; | |
const int sw_pin = 7; | |
// Still mode: 300ms or less | |
// Video mode: 300ms or more | |
const int pulese = 100; | |
void shootPules() { | |
digitalWrite(camera_pin, LOW); | |
FlexiTimer2::stop(); | |
} | |
void setup() { | |
pinMode(sw_pin, INPUT_PULLUP); | |
pinMode(camera_pin, OUTPUT); | |
FlexiTimer2::set(pulese, shootPules); | |
} | |
void loop() { | |
if (!digitalRead(sw_pin)){ | |
digitalWrite(camera_pin, HIGH); | |
FlexiTimer2::start(); | |
} | |
} |
0 件のコメント:
コメントを投稿