canon_ble #82
|
@ -1,3 +1,6 @@
|
|||
[submodule "scad/common"]
|
||||
path = scad/common
|
||||
url = https://git.sixteenmillimeter.com/modules/common.git
|
||||
[submodule "scad/sprocketed_roller"]
|
||||
path = scad/sprocketed_roller
|
||||
url = https://git.sixteenmillimeter.com/modules/sprocketed_roller.git
|
||||
|
|
|
@ -32,11 +32,13 @@ void McopySerial::_internal () {
|
|||
}
|
||||
|
||||
void McopySerial::_connect () {
|
||||
connected = true;
|
||||
Serial.println(CONNECT);
|
||||
log("connect()");
|
||||
}
|
||||
|
||||
void McopySerial::_identify () {
|
||||
identified = true;
|
||||
Serial.println(id);
|
||||
log("identify()");
|
||||
}
|
||||
|
|
|
@ -20,6 +20,9 @@ class McopySerial {
|
|||
|
||||
public:
|
||||
|
||||
volatile bool connected = false;
|
||||
volatile bool identified = false;
|
||||
|
||||
/* CMD FLAGS */
|
||||
const char BLACK = 'b';
|
||||
const char CAMERA = 'c';
|
||||
|
|
|
@ -32,11 +32,13 @@ void McopySerial::_internal () {
|
|||
}
|
||||
|
||||
void McopySerial::_connect () {
|
||||
connected = true;
|
||||
Serial.println(CONNECT);
|
||||
log("connect()");
|
||||
}
|
||||
|
||||
void McopySerial::_identify () {
|
||||
identified = true;
|
||||
Serial.println(id);
|
||||
log("identify()");
|
||||
}
|
||||
|
|
|
@ -20,6 +20,9 @@ class McopySerial {
|
|||
|
||||
public:
|
||||
|
||||
volatile bool connected = false;
|
||||
volatile bool identified = false;
|
||||
|
||||
/* CMD FLAGS */
|
||||
const char BLACK = 'b';
|
||||
const char CAMERA = 'c';
|
||||
|
|
|
@ -32,11 +32,13 @@ void McopySerial::_internal () {
|
|||
}
|
||||
|
||||
void McopySerial::_connect () {
|
||||
connected = true;
|
||||
Serial.println(CONNECT);
|
||||
log("connect()");
|
||||
}
|
||||
|
||||
void McopySerial::_identify () {
|
||||
identified = true;
|
||||
Serial.println(id);
|
||||
log("identify()");
|
||||
}
|
||||
|
|
|
@ -20,6 +20,9 @@ class McopySerial {
|
|||
|
||||
public:
|
||||
|
||||
volatile bool connected = false;
|
||||
volatile bool identified = false;
|
||||
|
||||
/* CMD FLAGS */
|
||||
const char BLACK = 'b';
|
||||
const char CAMERA = 'c';
|
||||
|
|
|
@ -32,11 +32,13 @@ void McopySerial::_internal () {
|
|||
}
|
||||
|
||||
void McopySerial::_connect () {
|
||||
connected = true;
|
||||
Serial.println(CONNECT);
|
||||
log("connect()");
|
||||
}
|
||||
|
||||
void McopySerial::_identify () {
|
||||
identified = true;
|
||||
Serial.println(id);
|
||||
log("identify()");
|
||||
}
|
||||
|
|
|
@ -20,6 +20,9 @@ class McopySerial {
|
|||
|
||||
public:
|
||||
|
||||
volatile bool connected = false;
|
||||
volatile bool identified = false;
|
||||
|
||||
/* CMD FLAGS */
|
||||
const char BLACK = 'b';
|
||||
const char CAMERA = 'c';
|
||||
|
|
|
@ -32,11 +32,13 @@ void McopySerial::_internal () {
|
|||
}
|
||||
|
||||
void McopySerial::_connect () {
|
||||
connected = true;
|
||||
Serial.println(CONNECT);
|
||||
log("connect()");
|
||||
}
|
||||
|
||||
void McopySerial::_identify () {
|
||||
identified = true;
|
||||
Serial.println(id);
|
||||
log("identify()");
|
||||
}
|
||||
|
|
|
@ -20,6 +20,9 @@ class McopySerial {
|
|||
|
||||
public:
|
||||
|
||||
volatile bool connected = false;
|
||||
volatile bool identified = false;
|
||||
|
||||
/* CMD FLAGS */
|
||||
const char BLACK = 'b';
|
||||
const char CAMERA = 'c';
|
||||
|
|
|
@ -34,6 +34,7 @@ CanonBLERemote canon_ble(name_remote);
|
|||
McopySerial mc;
|
||||
|
||||
volatile boolean connected = false;
|
||||
volatile boolean bleInit = false;
|
||||
|
||||
volatile long now;
|
||||
volatile long last = -1;
|
||||
|
@ -44,13 +45,18 @@ volatile char cmdChar = 'z';
|
|||
|
||||
void setup()
|
||||
{
|
||||
esp_log_level_set("*", ESP_LOG_INFO);
|
||||
esp_log_level_set("*", ESP_LOG_NONE);
|
||||
|
||||
pins();
|
||||
mc.begin(mc.CAMERA_IDENTIFIER);
|
||||
canon_ble.init();
|
||||
|
||||
delay(1000);
|
||||
digitalWrite(RED_LED, HIGH);
|
||||
digitalWrite(GREEN_LED, HIGH);
|
||||
|
||||
delay(42);
|
||||
|
||||
digitalWrite(RED_LED, LOW);
|
||||
digitalWrite(GREEN_LED, LOW);
|
||||
}
|
||||
|
||||
void pins () {
|
||||
|
@ -88,7 +94,7 @@ void loop()
|
|||
cmd(cmdChar);
|
||||
|
||||
// Shutter
|
||||
if (digitalRead(SHUTTTER_BTN) == LOW && last + 1000 < now){
|
||||
if (digitalRead(SHUTTTER_BTN) == LOW && connected){
|
||||
camera();
|
||||
}
|
||||
|
||||
|
@ -96,7 +102,15 @@ void loop()
|
|||
connected = false;
|
||||
}
|
||||
|
||||
if (!connected) {
|
||||
if (!bleInit && mc.connected && mc.identified) {
|
||||
mc.log("Initializing BLE...");
|
||||
canon_ble.init();
|
||||
bleInit = true;
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
if (!connected && mc.connected && mc.identified) {
|
||||
mc.log("Connecting BLE...");
|
||||
connectBLE();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,11 +32,13 @@ void McopySerial::_internal () {
|
|||
}
|
||||
|
||||
void McopySerial::_connect () {
|
||||
connected = true;
|
||||
Serial.println(CONNECT);
|
||||
log("connect()");
|
||||
}
|
||||
|
||||
void McopySerial::_identify () {
|
||||
identified = true;
|
||||
Serial.println(id);
|
||||
log("identify()");
|
||||
}
|
||||
|
|
|
@ -20,6 +20,9 @@ class McopySerial {
|
|||
|
||||
public:
|
||||
|
||||
volatile bool connected = false;
|
||||
volatile bool identified = false;
|
||||
|
||||
/* CMD FLAGS */
|
||||
const char BLACK = 'b';
|
||||
const char CAMERA = 'c';
|
||||
|
|
|
@ -50,9 +50,9 @@ module bellows_camera_board (magnets = false) {
|
|||
}
|
||||
|
||||
module bellows_lens_board (magnets = false) {
|
||||
H = 6;
|
||||
ProtrusionD = 37.25;
|
||||
ProtrusionH = 7;
|
||||
H = 3;
|
||||
ProtrusionD = 38.25;
|
||||
ProtrusionH = 5;
|
||||
InnerD = 34.5;
|
||||
difference () {
|
||||
union () {
|
||||
|
@ -122,7 +122,7 @@ module bellows_board_magnetic(H = 3) {
|
|||
}
|
||||
}
|
||||
|
||||
PART = "bellows_camera_board_magnetic";
|
||||
PART = "bellows_lens_board";
|
||||
|
||||
if (!LIBRARY && PART == "bellows_camera_board") {
|
||||
bellows_camera_board();
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Subproject commit e053ac5a2aa428248d6041a88e304c25df656bc0
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue