runtimejs / runtime

[not maintained] Lightweight JavaScript library operating system for the cloud
http://runtimejs.org
Apache License 2.0
1.93k stars 128 forks source link

More Hardware Devices #137

Open RossComputerGuy opened 7 years ago

RossComputerGuy commented 7 years ago

Is there a way to access these devices:

piranna commented 7 years ago

Is there a way to access these devices:

As Linus Tordvalds said, "Do you pine for the nice days of minix-1.1, when men were men and wrote their own device drivers?" ;-)

By the way, from your list, speakers and headphones are the (almost?) the same from a driver/computer perspective, and probably the most simple ones to develop because on their most simple behaviour it's just a matter of read and write on some specific ports, specially for the internal speaker/buzzer (it was a college practice for me, but almost no computer have it these days). The other ones are probably too much complex to write a driver from scratch, specially the USB protocol. Printers were easy to program when they used a parallel port (the same thing: just poke some port address), but today all printers are USB and no computer have a parallel port these days. Maybe you could have some luck with a serial port and program its UART...

Said that, there are bindings for Node.js for libusb library, but if you are into the mood of write a pure Javascript USB library (at least on a basic level, that's it, support a TTY-to-USB adapter so it can be connected to an Arduino board) then go for it :-)