1 Reply Latest reply on Feb 10, 2015 9:56 PM by Stan_Gifford

    Serial communication using C


      I'm trying to design a program that reads from a RPLiDAR.


      I've been having all sorts of trouble with serial on the edison. It seems too slow to keep up with data rate.


      I'm using the read() function to read in the bytes but bytes are being skipped. Is there a library out there that can simplify this?


      Can somebody give me a good example on how to read 5 bytes 2000 times per second.


      PS the values must be shared with other processes via IPC



      Is there a way to run two arduino loops on the board? I know how to read with the arduino process.

        • 1. Re: Serial communication using C

          Can't answer first question but theoretically the second could be answered (have not tried it).


          1. Download first sketch.

          2. SSH to Edison

          3. Move sketch from /sketch to a nice safe place - call it 'sketch1'


          4. Download second sketch

          5. SSH again

          6. COpy again - call it Sketch2

          7. CD to nice safe place

          execute Sketch1 - (Sketch2 is already running because you downloaded it in Step 4)


          As Arduino sketches are just normal Linux programs - this should work... YMMV