diff options
Diffstat (limited to 'src/inc/pwm')
-rwxr-xr-x | src/inc/pwm/pwm.c | 13 | ||||
-rwxr-xr-x | src/inc/pwm/pwm.h | 3 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/inc/pwm/pwm.c b/src/inc/pwm/pwm.c new file mode 100755 index 0000000..fac9347 --- /dev/null +++ b/src/inc/pwm/pwm.c | |||
@@ -0,0 +1,13 @@ | |||
1 | |||
2 | void pwminit() | ||
3 | { | ||
4 | TCCR0 |= (1<<WGM01); | ||
5 | } | ||
6 | |||
7 | void pwm_setInterval() | ||
8 | { | ||
9 | /// if(t_current.ms <= 500) | ||
10 | /// { OCR1A = 50 + (200 - (t_current.ms / 3)); } | ||
11 | /// else | ||
12 | /// { OCR1A = 50 + (200 - ((1000 - t_current.ms) / 3)); } | ||
13 | } | ||
diff --git a/src/inc/pwm/pwm.h b/src/inc/pwm/pwm.h new file mode 100755 index 0000000..8b671bc --- /dev/null +++ b/src/inc/pwm/pwm.h | |||
@@ -0,0 +1,3 @@ | |||
1 | #include <avr/io.h> | ||
2 | |||
3 | void pwminit(); | ||