Skip to content

Instantly share code, notes, and snippets.

View MDAR's full-sized avatar

MDAR Ltd MDAR

View GitHub Profile
@dmalawey
dmalawey / noderedExtractTwoValuesFromObject
Created September 9, 2020 07:26
make a function in nodered to extract individual axes from the gamepad
[{"id":"4a052b50.075214","type":"tab","label":"PlotGP","disabled":false,"info":""},{"id":"350633a1.11bc9c","type":"ui_gauge","z":"4a052b50.075214","name":"","group":"341ef7b5.bb9218","order":1,"width":"5","height":"5","gtype":"gage","title":"Axis0 (theta dot)","label":"percent","format":"{{value}}","min":"-100","max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":460,"y":280,"wires":[]},{"id":"1cbd9feb.395ee","type":"file in","z":"4a052b50.075214","name":"read uFile.txt","filename":"/tmp/uFile.txt","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":130,"y":120,"wires":[["7d96ee41.f7f52","9f412f87.46433"]]},{"id":"7d96ee41.f7f52","type":"csv","z":"4a052b50.075214","name":"parse values","sep":",","hdrin":"","hdrout":"none","multi":"one","ret":"\\n","temp":"GP_tdot, GP_xdot","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":190,"y":180,"wires":[["2c3f9ccf.818b84","d7dc5615.75ce08","99988631.c44068"]]},{"id":"2c3f9ccf.818b84","type":"debug
@jasonwhite
jasonwhite / joystick.c
Last active May 3, 2024 13:28
Reads joystick/gamepad events on Linux and displays them.
/**
* Author: Jason White
*
* Description:
* Reads joystick/gamepad events and displays them.
*
* Compile:
* gcc joystick.c -o joystick
*
* Run: