The last little while I've been tinkering with the RF24 library for those inexpensive Nordic based radios. Pretty neat. The hardest part has actually been getting a Processing sketch to parse the serial stream in a stable way; ie not chopping off a 32 byte packet at random places. I think the easy answer is to just stream a bunch of data into a buffer until a no-receive window happens, then parse the buffer.
Update!
Ah!
Seems (under OSX Yosemite / Processing 2.2.1, at least) that serial data arrives in 48 byte blobs from the driver. Nice.
I also switched to sending a start character trigger, and at 250000 bps a typical send (32 bytes/packet x 32 packets = 1024 bytes) takes at least 42ms, but occasionally up to 73ms, but 50ms seems about right.
I also discovered that one of the odd things that was fouling up processing was a weird behavior of the control.p5 library; it was causing a long delay at the end of every loop() pass.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.