SWARM-Bot Firmware  v1.0
Mobile robot OS - Embedded C/C++
__pwm__.h File Reference

Header file for pwm.c. More...

#include <__swarm_wold__.h>
Include dependency graph for __pwm__.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void _set_pwm_0A (int input)
 
void _set_pwm_0B (int input)
 
void _set_pwm_1A (int input)
 
void _set_pwm_1B (int input)
 

Detailed Description

Header file for pwm.c.

  • File: pwm.h
  • Compiler: GCC-AVR
  • Supported devices: Tested on 328p
  • AppNote: PWM driver
Author
Swarm robot graduation project workgroub
Mechatronics Program for the Distinguished
$Name$
Revision
1

$RCSfile$

Date
/19/2021 9:30:13 AM

Definition in file __pwm__.h.

Function Documentation

◆ _set_pwm_0A()

void _set_pwm_0A ( int  input)

sets the PWM output of OCR0A (Motor A rear)

Parameters
[in]input
inputa number (0 --> 255)
9 {
10  if (input > 255)
11  {input = 255;}
12  else if (input < 0)
13  {input = 0;}
14 
15 
16  OCR0A = (uint8_t)input;
17 }

◆ _set_pwm_0B()

void _set_pwm_0B ( int  input)

sets the PWM output of OCR0B (Motor B rear)

Parameters
[in]input
inputa number (0 --> 255)
23 {
24 
25  if (input > 255)
26  {input = 255;}
27  else if (input < 0)
28  {input = 0;}
29 
30  OCR0B = (uint8_t)input;
31 }

◆ _set_pwm_1A()

void _set_pwm_1A ( int  input)

sets the PWM output of OCR1A (Motor A front)

Parameters
[in]input
inputa number (0 --> 255)
37 {
38  if (input > 255)
39  {input = 255;}
40  else if (input < 0)
41  {input = 0;}
42 
43 
44  OCR1AH = (uint8_t)(input);
45  OCR1AL = 0;
46 }

◆ _set_pwm_1B()

void _set_pwm_1B ( int  input)

sets the PWM output of OCR1B (Motor B front)

Parameters
[in]input
inputa number (0 --> 255)
52 {
53  if (input > 255)
54  {input = 255;}
55  else if (input < 0)
56  {input = 0;}
57 
58 
59  OCR1BH = (uint8_t)(input);
60  OCR1BL = 0;
61 }