Add files via upload

This commit is contained in:
granaa
2018-02-03 16:47:36 -08:00
committed by GitHub
parent e9691eee5f
commit 105925a263
6 changed files with 84 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
This library is for use with the chdk cannon firmware.
it allows an arduino-like board to control zoom and shoot.
to enable this funcionality on the camera load firmware, enter <alt> mode, press menu, CHDK settings, Remote Parameters, enable remote, and set control mode to "zoom".

View File

@@ -0,0 +1,47 @@
#include<camera.h>
camera::camera(int pinn){
pinMode(pinn, OUTPUT);
pin = pinn;
}
void camera::pulse(){
digitalWrite(pin,HIGH);
delay(105);
digitalWrite(pin,LOW);
delay(55);
}
void camera::kill(){
digitalWrite(pin,LOW);
delay(455);
}
void camera::shoot(){
for(int i=0;i<3;i++)
pulse();
kill();
}
void camera::slowZoomIn(){
pulse();
kill();
}
void camera::slowZoomOut(){
pulse();
pulse();
kill();
}
void camera::fullZoomIn(){
for(int i=0;i<4;i++)
pulse();
kill();
}
void camera::fullZoomOut(){
for(int i=0;i<5;i++)
pulse();
kill();
}

View File

@@ -0,0 +1,18 @@
//camera firmware can be found at chdk.wikia.com
#include <Arduino.h>
class camera{
private:
int pin;
float zm;
void kill();
public:
camera(int);
void pulse();
void shoot();
void slowZoomIn();
void slowZoomOut();
void fullZoomIn();
void fullZoomOut();
void focus();
};

View File

@@ -0,0 +1,14 @@
#include <camera.h>
int cameraPin = 7;
camera science(cameraPin);
void setup() {
}
void loop() {
science.fullZoomIn();
delay (2000);
science.fullZoomOut();
delay(2000);
}