In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article is to share with you the content of an example analysis of JY901 NOTES TM4 serial data reading. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Serial port reading module data
Here I attach my serial data reading function which is modified on the basis of the routines provided by the manufacturer (although it is very simple, it can save the time of the brother who sees the post).
First, TM4 serial port 1 initializes:
# define UART1Baud 115200void initUART1 () {ROM_SysCtlPeripheralEnable (SYSCTL_PERIPH_GPIOB); ROM_SysCtlPeripheralEnable (SYSCTL_PERIPH_UART1); ROM_GPIOPinConfigure (GPIO_PB0_U1RX); ROM_GPIOPinConfigure (GPIO_PB1_U1TX); ROM_GPIOPinTypeUART (GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1) ROM_UARTConfigSetExpClk (UART1_BASE, ROM_SysCtlClockGet (), UART1Baud, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); ROM_IntEnable (INT_UART1); UARTFIFODisable (UART1_BASE); UARTIntRegister (UART1_BASE,UART1_Handler); ROM_UARTIntEnable (UART1_BASE,UART _ INT_RX | UART_INT_RT);}
Then interpret it according to the agreement of the manual:
Float roll=0,pitch=0,yaw=0; float accX=0,accY=0,accZ=0; float gyrX=0,gyrY=0,gyrZ=0 Void JY901_GetOneByte (U8 data) {static U8 ucRxBuffer [12]; static U8 ucRxCnt=0; ucRxBuffer [ucRxCnt++] = data; if (ucRxBuffer [0]! = 0x55) {ucRxCnt=0; return } if (ucRxCnt
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.