eBoard ๐Ÿ‰  โ‘ โ‘งโ‘จ
Written for SIA 2017/2018
eagle_ReptTask.h
Go to the documentation of this file.
1 #ifndef EAGLE_EBOARD_HELPLIB_REPTTASK
2 #define EAGLE_EBOARD_HELPLIB_REPTTASK
3 
5 void trig_rept_task(void);
6 
8  void trig_rept_task() {
9  #if EBOARD_NANO == 0x0 || defined(DOC)
10  if (_pwmValue!=_OpwmValue){
11  analogWrite(PIN_MOTOR_SPE,_pwmValue);
13  }
14  #endif
15  #ifdef REPT_TASK
16  rept_task();
17  #endif
18 
19  }
20  #if EBOARD_NANO > 0x0
21  Servo mainMotor,steerMotor;
22  #endif
23  int timer_count = 0;
24  bool timer_ofl = false;
25  ISR(TIMER2_OVF_vect) {
26  timer_count++;
27  if(timer_count >= EBOARD_PWM_SPE*1000 && !timer_ofl){
28  timer_ofl = true;
29  timer_count -= EBOARD_PWM_SPE*1000;
31  timer_ofl = false;
32  }
33  TCNT2 = 256 - (int)((float)F_CPU * 0.001 / 64);
34  }
36 #endif
#define PIN_MOTOR_SPE
Definition: eBoard.h:427
void trig_rept_task(void)
this is the method that will call rept_task
#define EBOARD_PWM_SPE
Definition: eBoard.h:319
optVAL_t _pwmValue
Definition: eagle_PinCtrl.h:4
optVAL_t _OpwmValue
Definition: eagle_PinCtrl.h:4
The standard Arduino Servo Class.
Definition: eagle_Servo.h:50