本文整理汇总了C++中Laser::extinguish方法的典型用法代码示例。如果您正苦于以下问题:C++ Laser::extinguish方法的具体用法?C++ Laser::extinguish怎么用?C++ Laser::extinguish使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Laser
的用法示例。
在下文中一共展示了Laser::extinguish方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Init
void Laser::Init() {
// Initialize timers for laser intensity control
#if LASER_CONTROL == 1
#if IS_TIMER_3_PWR
timer3_init(LASER_PWR_PIN);
#elif IS_TIMER_4_PWR
timer4_init(LASER_PWR_PIN);
#endif
#elif LASER_CONTROL == 2
#if IS_TIMER_3_PWM
timer3_init(LASER_PWM_PIN);
#elif IS_TIMER_4_PWM
timer4_init(LASER_PWM_PIN);
#endif
#endif
#if ENABLED(LASER_PERIPHERALS)
OUT_WRITE(LASER_PERIPHERALS_PIN, HIGH); // Laser peripherals are active LOW, so preset the pin
OUT_WRITE(LASER_PERIPHERALS_STATUS_PIN, HIGH); // Set the peripherals status pin to pull-up.
#endif
#if LASER_CONTROL == 2
OUT_WRITE(LASER_PWR_PIN, LASER_UNARM); // Laser FIRING is active LOW, so preset the pin
#endif
// initialize state to some sane defaults
laser.intensity = 100.0;
laser.ppm = 0.0;
laser.duration = 0;
laser.status = LASER_OFF;
laser.firing = LASER_ON;
laser.mode = CONTINUOUS;
laser.last_firing = 0;
laser.diagnostics = false;
laser.time = 0;
#if ENABLED(LASER_RASTER)
laser.raster_aspect_ratio = LASER_RASTER_ASPECT_RATIO;
laser.raster_mm_per_pulse = LASER_RASTER_MM_PER_PULSE;
laser.raster_direction = 1;
#endif // LASER_RASTER
laser.extinguish();
}