此帖出自stm32/stm8论坛
最新回复
本帖最后由 freebsder 于 2019-4-24 15:00 编辑
<pre>
<code class="language-cpp">#include "stm32f10x.h"
#include "bsp_led.h"
#include "bsp_usart.h"
int main()
{
uint8_t ch;
uint8_t a[10]={1,2,3,4,5,6,7,8,9,10};
USART_Config();
USART_SendByte(DEBUG_USARTx , 0x64);//01100100
printf("\n");
USART_Send2Byte(DEBUG_USARTx , 0xff56);
printf("\n");
USART_SendArray(DEBUG_USARTx , a,10);
printf("\n");
USART_SendString(DEBUG_USARTx, "sendString");
printf("\n");
printf("chuankou printf函数测试\n");
putchar('b');
printf("\n");
while(1)
{
// ch = getchar();
ch = '1';
printf("ch = %c\n",ch);
switch(ch)
{
case '1':LED_GREEN;
break;
case '2':LED_BLUE;
break;
case '3':LED_RED;
break;
default:LED_RGBOFF;
break;
}
}
}</code></pre>
<p> </p>
详情
回复
发表于 2019-4-23 17:14
| ||
|
||
此帖出自stm32/stm8论坛
| ||
个人签名
默认摸鱼,再摸鱼。2022、9、28 |
||
EEWorld Datasheet 技术支持