Home > other >  In the Keil printf
In the Keil printf

Time:09-25

Wrote a motor driver code, but using the printf function cannot send content to the serial port, only 3 of the PWM timer output initialization TIM3_Init_pwmout,47 (99) commented, printf can send content to the serial port, please advise,
Int main ()
{
Int a=0, b, c, d=0;
Uart_init (115200);
Motor_Init ();
LED_Init ();
TIM3_Init_pwmout,47 (99);
Delay_init ();
Printf (" % d ", d + 1);
LED0=! LED0;
Delay_ms (5000);
Printf (" % d ", d);
While (1)
{
LED0=! LED0;
Delay_ms (500);

LED1=! LED1;
Delay_ms (500);
B=+ + a;
C=a + 15;
Printf (" % d, % d, b, c)

}
}

CodePudding user response:

Don't know what are you doing this function TIM3_Init_pwmout is inside, but you can use the method, the function inside the content of the shielding effect, slowly because if it is you this function inside some array with super will be abnormal

CodePudding user response:

Probably in TIM3 function is dead, didn't run to the printf.
I commonly used fault debugging method: LED lamp positioning,
You add a line under the TIM3 - Init, open lamp, can see run to this line,

CodePudding user response:

Have solve the problem,
  • Related