In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-23 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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.