Bash, serial I/O and Arduino

后端 未结 10 2340
眼角桃花
眼角桃花 2020-12-23 18:53

So, I\'m in a bit over my head, and I feel like I\'m very close to a solution, but it\'s just not working quite yet. Here\'s my situation:

I\'m working with an Ardui

10条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-23 19:17

    A one-liner Something that works really well for datalogging, and acting on data:

    Summary
    • monitoring: the arduino output can trigger actions on the computer
    • data-logging: it simultaneously save that streaming data to a file
    • notchecked? sending-messages: I haven't tried sending data yet to the arduino, but see the second example, might be able to send a message to the serial port via some cmdline util.

    the following timestamps and sends to stdout

    cat /dev/cu.usbmodem1421 | awk '{ for (i=0; i

    Sample Output:

    enter image description here

    This method can even be adapted to monitor and act upon the data in real time:

    cat /dev/cu.usbmodem1421 | awk '{ for (i=0; i

    more examples here: https://github.com/gskielian/Arduino-DataLogging/tree/master/Bash-One-Liner

提交回复
热议问题