Serial communication from JavaScript?

前端 未结 7 2016
感情败类
感情败类 2020-12-28 19:46

Is it possible to communicate over a machine\'s serial port through JavaScript?

I have to write a short program that sends data to a microcontroller over the serial

相关标签:
7条回答
  • 2020-12-28 20:22

    JavaScript itself doesn't have any built in functionality to allow you to access the serial port. However, various JavaScript engines (v8, rhino, etc) allow you to write your own custom native objects.

    You might want to check out node.js, which is a JavaScript library for v8 that's focused on writing server-side code (rather than web browser client code). It seems that someone's already written a serialport package for that:

    https://github.com/voodootikigod/node-serialport

    0 讨论(0)
提交回复
热议问题