Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
103
rated 0 times [  108] [ 5]  / answers: 1 / hits: 70591  / 13 Years ago, tue, april 12, 2011, 12:00:00

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 port that has a GUI and is cross-platform compatible, and I really don't want to use Java's Swing.


More From » serial-port

 Answers
122

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


[#92777] Monday, April 11, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
brandt

Total Points: 43
Total Questions: 90
Total Answers: 111

Location: Aruba
Member since Fri, Jun 24, 2022
2 Years ago
brandt questions
Sun, Jul 4, 21, 00:00, 3 Years ago
Wed, Jun 30, 21, 00:00, 3 Years ago
Sat, Jan 23, 21, 00:00, 3 Years ago
Mon, Sep 21, 20, 00:00, 4 Years ago
;