Rev 1242 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1242 | Rev 1265 | ||
---|---|---|---|
Line 226... | Line 226... | ||
226 | static int16_t ServoRollOffset = (255 / 2) * MULTIPLYER; // initial value near center positon |
226 | static int16_t ServoRollOffset = (255 / 2) * MULTIPLYER; // initial value near center positon |
Line 227... | Line 227... | ||
227 | 227 | ||
228 | // Arthur P: Added initialization of the CameraShutterCycle value here as this routine is only |
228 | // Arthur P: Added initialization of the CameraShutterCycle value here as this routine is only |
229 | // called once. This retains all code changes in timer0.c. If parameter 6 > 0 then the user |
229 | // called once. This retains all code changes in timer0.c. If parameter 6 > 0 then the user |
230 | // has set a value for the cycle. CameraShuytterCycle == 5x Para6 to get approx 0.1sec increments. |
- | |
- | 230 | // has set a value for the cycle. CameraShuytterCycle == 5x Para6 to get approx 0.1sec increments. |
|
231 | 231 | // 090807: Arthur P.: Removed the shutter cycle parts as they may be impacting timing loops. |
|
232 | // CameraShutterCycle = 5 * Parameter_UserParam6; |
232 | // CameraShutterCycle = 5 * Parameter_UserParam6; |
Line 233... | Line 233... | ||
233 | CameraShutterCycle = Parameter_UserParam6; |
233 | // CameraShutterCycle = Parameter_UserParam6; |
234 | 234 | ||
235 | // Arthur P: Modified the code to scheck the value of parameter 8. If 128 or higher then a HEF4017 is |
235 | // Arthur P: Modified the code to scheck the value of parameter 8. If 128 or higher then a HEF4017 is |
Line 405... | Line 405... | ||
405 | // Set servo to null position, turning camera off. |
405 | // Set servo to null position, turning camera off. |
406 | RemainingPulse = MINSERVOPULSE; |
406 | RemainingPulse = MINSERVOPULSE; |
407 | } |
407 | } |
408 | else |
408 | else |
409 | { |
409 | { |
- | 410 | // 090807: Arthur P.: Removed the shutter cycle parts as they may be impacting timing loops. |
|
410 | if(PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] > 32) |
411 | // if(PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] > 32) |
411 | // Middle position on a 3 position switch which runs from -127 to +127 |
412 | // Middle position on a 3 position switch which runs from -127 to +127 |
412 | { |
413 | // { |
Line 413... | Line 414... | ||
413 | 414 | ||
414 | RemainingPulse = MINSERVOPULSE + SERVORANGE/2; |
415 | RemainingPulse = MINSERVOPULSE + SERVORANGE/2; |
415 | } |
416 | // } |
416 | else |
417 | // else |
417 | { |
418 | // { |
418 | // Cycle shutter servo between on and off depending upon CameraShutterCycleCounter |
419 | // Cycle shutter servo between on and off depending upon CameraShutterCycleCounter |
419 | // If CameraShutterCylce < 50 then default to continuous shoot. |
420 | // If CameraShutterCylce < 50 then default to continuous shoot. |
420 | if(CameraShutterCycle < 50 ) |
421 | //if(CameraShutterCycle < 50 ) |
421 | { |
422 | // { |
422 | RemainingPulse = MINSERVOPULSE + SERVORANGE/2; |
423 | RemainingPulse = MINSERVOPULSE + SERVORANGE/2; |
423 | } |
424 | // } |
424 | else |
425 | // else |
425 | { |
426 | // { |
426 | if(CameraShutterCycleCounter == CameraShutterCycle) |
427 | // if(CameraShutterCycleCounter == CameraShutterCycle) |
427 | { |
428 | // { |
428 | // Shutter on |
429 | // Shutter on |
429 | CameraShutterCycleCounter = 0; |
430 | // CameraShutterCycleCounter = 0; |
430 | RemainingPulse = MINSERVOPULSE + SERVORANGE/2; |
431 | // RemainingPulse = MINSERVOPULSE + SERVORANGE/2; |
431 | } |
432 | // } |
432 | else |
433 | // else |
433 | { |
434 | // { |
434 | // Leave on for at least 24 cycles or 0.25 seconds to allow |
435 | // Leave on for at least 24 cycles or 0.25 seconds to allow |
435 | // the camera to properly trigger, turn off if past 0.25 sec. |
436 | // the camera to properly trigger, turn off if past 0.25 sec. |
436 | // For now this is actually set via para5 to allow for a long enough |
437 | // For now this is actually set via para5 to allow for a long enough |
437 | // shutter pulse for different cameras. Once it is clear what value |
438 | // shutter pulse for different cameras. Once it is clear what value |
438 | // works, this can be changed to a hardcoded value. |
439 | // works, this can be changed to a hardcoded value. |
439 | if(CameraShutterCycleCounter>Parameter_UserParam5) |
440 | // if(CameraShutterCycleCounter>Parameter_UserParam5) |
Line 440... | Line 441... | ||
440 | { |
441 | // { |
441 | 442 | ||
442 | RemainingPulse = MINSERVOPULSE; |
443 | // RemainingPulse = MINSERVOPULSE; |
- | 444 | // } |
|
- | 445 | // CameraShutterCycleCounter++; |
|
- | 446 | // } |
|
443 | } |
447 | // } |
444 | CameraShutterCycleCounter++; |
- | |
445 | } |
- | |
446 | } |
- | |
447 | } |
- | |
448 | } |
- | |
449 | break; |
- | |
450 | - | ||
451 | default: // other servo channels |
448 | // } |
- | 449 | } |
|
- | 450 | break; |
|
- | 451 | // 090807 Arthur P: Removed the output of the remaining channels as this just eats time and probably |
|
- | 452 | // does not have much of a function. Better to add specific outputs as needed. |
|
- | 453 | // default: // other servo channels |
|
452 | RemainingPulse += 2 * PPM_in[ServoIndex]; // add channel value, factor of 2 because timer 1 increments 3.2µs |
454 | // RemainingPulse += 2 * PPM_in[ServoIndex]; // add channel value, factor of 2 because timer 1 increments 3.2µs |
453 | break; |
455 | // break; |
454 | } |
456 | } |
455 | // range servo pulse width |
457 | // range servo pulse width |
456 | if(RemainingPulse > MAXSERVOPULSE ) RemainingPulse = MAXSERVOPULSE; // upper servo pulse limit |
458 | if(RemainingPulse > MAXSERVOPULSE ) RemainingPulse = MAXSERVOPULSE; // upper servo pulse limit |