This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
工具/软件:Code Composer Studio
无法发送或接收来自蓝牙模块 HC 05的数据、并在 CCS-中写入以下代码
#include
#include
#include
#include "inc/tm4c123gh6m.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "inc/hw_ints.h"
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"
#include "driverlib/timer.h"
#include "driverlib/interrupt.h"
#include
#include
#include" driverlib/pin_map.h"
#include" driverlib/sysctl.h"
#include" driverlib/uart.h"
#include" driverlib/uart.c"
#include "driverlib/adc.h"
//int32_t d='x';
unsigned char d;
int main (空)
{
int u=0;
/*设置蓝牙 UART*/
SysCtlClockSet (SYSCTL_SYSDIV_10|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHz|SYSCTL_OSC_MAIN);
SysCtlPeripheralEnable (SYSCTL_Periph_GPIOB);
SysCtlPeripheralEnable (SYSCTL_Periph_GPIOF);
SysCtlPeripheralEnable (SYSCTL_Periph_UART1);
GPIOPinConfigure (GPIO_PB0_U1RX);
GPIOPinConfigure (GPIO_PB1_U1TX);
/*上拉 PB0和 PB1 */
GPIOPadConfigSet (GPIO_PORTB_BASE、GPIO_PIN_0、GPIO_Strength _2mA、GPIO_PIN_TYPE_STD_WPU);
/*使 UART 引脚受外设控制。 *
GPIOPinTypeUART (GPIO_PORTB_BASE、GPIO_PIN_0 | GPIO_PIN_1);
/*设置 UART 的配置。 *
UARTConfigSetExpClk (UART1_base、16000000、9600、(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));
// while (UARTCharsAvail (UART1_base));
//
// unsigned char d = UARTCharGet (UART1_base);
//UARTCharPut (UART1_base、'b');
while (1)
{
D = UARTCharGet (UART1_BASE);
UARTCharPut (UART1_BASE、76);
UARTCharPut (UART1_base、'b');
UARTCharPut (UART1_base、'c');}
返回0;
}