canon_ble #82

Merged
mattmcw merged 149 commits from canon_ble into main 2023-08-01 03:38:52 +00:00
2 changed files with 32 additions and 1 deletions
Showing only changes of commit a7db072dc6 - Show all commits

View File

@ -34,7 +34,7 @@ volatile long blinkLast = 0;
volatile long now;
volatile long last = -1;
volatile long cameraFrame = 2000;
volatile long cameraFrame = 3000;
volatile long start;
volatile long end;
@ -43,6 +43,8 @@ volatile char cmdChar = 'z';
volatile char sChar = 'z';
volatile bool connectedOnce = false;
volatile String exposureString;
volatile long exposureTarget = 3000;
void setup () {
@ -102,12 +104,25 @@ void cmd (char val) {
camera_direction(true);
} else if (val == mc.CAMERA_BACKWARD) {
camera_direction(false);
} else if (val == mc.CAMERA_EXPOSURE) {
exposure();
} else if (val == mc.STATE) {
state();
}
cmdChar = 'z';
}
void exposure () {
exposureString = mc.getString();
parseExposureString();
cameraFrame = exposureTarget;
mc.confirm(mc.CAMERA_EXPOSURE);
}
void parseExposureString () {
exposureTarget = exposureString.toInt();
}
void s_cmd (char val) {
if (val == 'C') {
connected = true;

View File

@ -32,6 +32,9 @@ volatile int cameraFrame = 2000;
volatile char cmdChar = 'z';
volatile long now;
volatile String exposureString;
volatile long exposureTarget = 2000;
McopySerial mc;
void setup () {
@ -68,11 +71,24 @@ void cmd (char val) {
camera_direction(false);
} else if (val == mc.CAMERA) {
camera();
} else if (val == mc.CAMERA_EXPOSURE) {
exposure();
} else if (val == mc.STATE) {
state();
}
}
void exposure () {
exposureString = mc.getString();
parseExposureString();
cameraFrame = exposureTarget;
mc.confirm(mc.CAMERA_EXPOSURE);
}
void parseExposureString () {
exposureTarget = exposureString.toInt();
}
//null route direction
void camera_direction (boolean state) {
if (state) {