Last active
September 6, 2016 18:54
-
-
Save hakant/7ee37ee00fccfbf487d2c6d3328f13dd to your computer and use it in GitHub Desktop.
pseudo node.js code that reads inputs from playstation buzz controllers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var HID = require('node-hid'); | |
var bitwise = require('bitwise'); | |
var socket = require('socket.io-client')('https://frill-crafter.hyperdev.space'); | |
device.on("data", function(data) { | |
// Interpret data buffer and figure out which buttons on which controllers are being pressed | |
// ... Visit https://github.com/hakant/NfieldQuizGame to see the actual code | |
// Then emit the following message to the socket.io server running on hyperdev (for each controller) | |
socket.emit('button-clicked', `{ "ControllerId": ${controllerId}, "ButtonId": ${buttonId} }`); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment