pwm uart gpio i2c
This commit is contained in:
@@ -8,12 +8,12 @@ void PWM_Channel1(uint16_t Compare)
|
||||
|
||||
void PWM_Channel2(uint16_t Compare)
|
||||
{
|
||||
//DL_TimerA_setCaptureCompareValue(PWM_0_INST,Compare,GPIO_PWM_0_C1_IDX);
|
||||
DL_TimerA_setCaptureCompareValue(PWM_0_INST,Compare,GPIO_PWM_0_C1_IDX);
|
||||
}
|
||||
|
||||
void PWM_Channel3(uint16_t Compare)
|
||||
{
|
||||
//DL_TimerA_setCaptureCompareValue(PWM_0_INST,Compare,GPIO_PWM_0_C2_IDX);
|
||||
DL_TimerA_setCaptureCompareValue(PWM_0_INST,Compare,GPIO_PWM_0_C2_IDX);
|
||||
}
|
||||
|
||||
|
||||
|
||||
9
empty.c
9
empty.c
@@ -36,12 +36,14 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <pwm.h>
|
||||
|
||||
extern float angle_f;
|
||||
|
||||
const float num_f = 0.123456f;
|
||||
|
||||
volatile uint16_t count = 0 ;
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
@@ -55,6 +57,11 @@ int main(void)
|
||||
volatile float angle_rad = GetAngle();
|
||||
//printf("test \n");
|
||||
printf("angle %.5f \n" , angle_rad);
|
||||
|
||||
PWM_Channel1(count ++);
|
||||
if(count == 750)
|
||||
count = 0;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -439,6 +439,16 @@
|
||||
<FileType>5</FileType>
|
||||
<FilePath>..\3rd\uart_redircet.h</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>pwm.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\3rd\pwm.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>pwm.h</FileName>
|
||||
<FileType>5</FileType>
|
||||
<FilePath>..\3rd\pwm.h</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
</Groups>
|
||||
|
||||
Reference in New Issue
Block a user