Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: CalibrateMagneto QuaternionMath
Fork of SML2 by
CherryCam.cpp
00001 #include "CherryCam.h" 00002 00003 CherryCam::CherryCam() : powerPin(p26), shutterPin(p30), recording(false) 00004 { 00005 powerPin = 0; // keep off initially 00006 } 00007 00008 void CherryCam::powerOn() 00009 { 00010 powerPin = 1; 00011 } 00012 00013 void CherryCam::powerOff() 00014 { 00015 powerPin = 0; 00016 } 00017 00018 void CherryCam::start() 00019 { 00020 if (recording) 00021 return; 00022 00023 generateFallingEdge(); 00024 } 00025 00026 void CherryCam::stop() 00027 { 00028 if (!recording) 00029 return; 00030 00031 generateFallingEdge(); 00032 } 00033 00034 void CherryCam::generateFallingEdge() 00035 { 00036 shutterPin = 1; 00037 pulldownTimer.attach(this, &CherryCam::pulldownShutterPin, 0.5); // pull down after 1 sec 00038 } 00039 00040 void CherryCam::pulldownShutterPin() 00041 { 00042 shutterPin = 0; 00043 recording = !recording; 00044 }
Generated on Wed Jul 13 2022 08:50:41 by
