牛卧堂MCU技术交流

标题: [NUC123] HID RF-Mouse through RF24L01 [打印本页]

作者: admin    时间: 2022-9-15 10:40
标题: [NUC123] HID RF-Mouse through RF24L01


This sample code uses SPI0 interface to initialize RF24L01 and make it as the receiving mode to receive the data. After receiving the RF data, the corresponding data will be converted into the mouse movement direction value after processing, and the data will be uploaded to PC through USB to control the mouse action.

Use a timer to record, if 50ms does not receive data, frequency hopping once.

The IRQ (external GPIO) interrupt is used to detect whether data is received. If data is received, an IRQ interrupt will be generated. In the IRQ interrupt, if the received data flag is detected, the data will be read. If the first data is 0xAA, the second byte data will be judged and stored in the RF key variable.

You can download the sample code at https://www.nuvoton.com/resource-downlo ... 1225163829





欢迎光临 牛卧堂MCU技术交流 (http://www.nuvoton-mcu.com/) Powered by Discuz! X3.2