eBoard ๐
โ โงโจ
Written for SIA 2017/2018
Main Page
Pages
Tutorials
Namespaces
Classes
Files
File List
File Members
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
);
12
_OpwmValue
=
_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;
30
trig_rept_task
();
31
timer_ofl =
false
;
32
}
33
TCNT2 = 256 - (int)((
float
)F_CPU * 0.001 / 64);
34
}
36
#endif
PIN_MOTOR_SPE
#define PIN_MOTOR_SPE
Definition:
eBoard.h:427
trig_rept_task
void trig_rept_task(void)
this is the method that will call rept_task
EBOARD_PWM_SPE
#define EBOARD_PWM_SPE
Definition:
eBoard.h:319
_pwmValue
optVAL_t _pwmValue
Definition:
eagle_PinCtrl.h:4
_OpwmValue
optVAL_t _OpwmValue
Definition:
eagle_PinCtrl.h:4
Servo
The standard Arduino Servo Class.
Definition:
eagle_Servo.h:50
eBoard
source
eagle_ReptTask.h
[WIP-BUILD]
EagleoutIce
19.04.2018 16:49:12