{"id":19489454,"url":"https://github.com/1j01/nxt-ultrasonic-mouser","last_synced_at":"2026-06-19T14:32:47.193Z","repository":{"id":20645986,"uuid":"23927961","full_name":"1j01/nxt-ultrasonic-mouser","owner":"1j01","description":"Use the NXT's ultrasonic sensor to control the mouse and thus games and things.","archived":false,"fork":false,"pushed_at":"2019-04-02T01:44:54.000Z","size":153,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-18T14:33:55.340Z","etag":null,"topics":["lego","mindstorms","mouse","nxt","nxt-brick","nxt-python","python","ultrasonic","ultrasonic-sensor"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/1j01.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-11T17:16:43.000Z","updated_at":"2023-08-03T19:17:36.000Z","dependencies_parsed_at":"2022-08-24T07:21:16.617Z","dependency_job_id":null,"html_url":"https://github.com/1j01/nxt-ultrasonic-mouser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/1j01/nxt-ultrasonic-mouser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1j01%2Fnxt-ultrasonic-mouser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1j01%2Fnxt-ultrasonic-mouser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1j01%2Fnxt-ultrasonic-mouser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1j01%2Fnxt-ultrasonic-mouser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1j01","download_url":"https://codeload.github.com/1j01/nxt-ultrasonic-mouser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1j01%2Fnxt-ultrasonic-mouser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34536276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lego","mindstorms","mouse","nxt","nxt-brick","nxt-python","python","ultrasonic","ultrasonic-sensor"],"created_at":"2024-11-10T21:08:38.372Z","updated_at":"2026-06-19T14:32:47.167Z","avatar_url":"https://github.com/1j01.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# NXT Ultrasonic Mouser\n\nUsing the Lego Mindstorms NXT 2.0 Ultrasonic Sensor to play [Plink](http://labs.dinahmoe.com/plink/) like a [theremin](https://en.wikipedia.org/wiki/Theremin) and games like a boss.\n\n## Setup\n\nUsing Python 2.7, PyMouse, nxt-python-2.2.2\n\nLet me be frank, this thing is probably a pain to set up. Maybe not on linux, though?\n\n### Linux\n\nInstructions are for USB connection, but [nxt-python](https://code.google.com/p/nxt-python/wiki/Installation) also allows for Bluetooth and NXT's Fantom driver.\n\n```shell\ncd nxt-python\nsudo python setup.py install\ncd ../PyMouse\nsudo python setup.py install\ncd ..\nsudo apt-get install python-xlib python-usb\n```\n\nThat should work, more or less. I haven't exactly tested it, as such.\n\n### Windows\n\nYou'll need to open up an administrative command prompt and get your hands dirty.\n\n##### PyMouse\n\nPyMouse depends on [pywin32](http://sourceforge.net/projects/pywin32/files/) and [pyHook](http://sourceforge.net/projects/pyhook/files/pyhook/).\nYou can download installers for those from their project pages on SourceForge.\nRun `python` (`^Z Enter`) to see whether you have 64bit or 32bit python installed.\nDownload the appropriate installers based on this.\n\n##### NXT-Python\n\nFor nxt-python to work, you need to install a communication module.\n\n###### PyBluez\n\nBluetooth is probably the easiest method.\nObviously it requires either a Bluetooth dongle or built-in Bluetooth functionality.\n\nInstall PyBluez with `pip install pybluez` or by downloading and running their installer on PyPI.\n\n###### PyFantom\n\nI got this to work for about ten seconds after searching for, downloading, extracting and installing\nLego's [NXT Fantom Driver](http://www.lego.com/en-us/mindstorms/downloads/nxt/nxt-fantom-driver/),\nsearching for, downloading, extracting and installing PyFantom\nwhich says windows support is \"to be determined\"\nand then gives an error \"Unsupported platform\",\nrage-quiting,\nsuspecting it's an outdated version,\nfinding, downloading, extracting and installing the master version\nand updating all my code.\n\nThen it stopped working.\n\n###### PyUSB\n\nNXT-Python has it's backends and one of them is PyUSB. PyUSB has its own set of backends.\n\nSome of them seem to support Windows.\n\n...and libusb-win32 just sort of blocked even the official NXT software from connecting to the NXT and it's all like\n\"The device driver can not be easily removed from the system.\nYou can however try to use [​usbdeview](#IamNotInstallingSomethingToUninstallSomething!)\nto remove the entries...\"\nYou can however uninstall it from the \"Device Manager\" (without downloading additional software!)\n\n### Mac\n\nI don't have a mac.\n\n## Usage\n\nIt's not supposed to move the mouse when you're not interacting with it, but if it goes rouge, just turn off your NXT.\n\n1. Turn on the NXT and connect it to your computer.\n2. Connect the Ultrasonic sensor to port 4. You'll probably want to attach it directly to the NXT brick.\n3. Use `sudo python main.py`. (If you don't want to use sudo, you can apparently configure some udev rules for USB access, but I haven't tried this)\n4. You'll probably get a BrickNotFound error or something else. Good luck.\n5. Calibration: Follow the instructions. If you want to use it by casually pointing, calibrate it by casually pointing. The settings are stored in `config.ini`. To recalibrate, use `sudo python main.py --recalibrate`\n\n```\nusage: (sudo) main.py [-h] [-d {left,right,up,down}] [-r] [-c] [-b] [-w]\n\nNXT Ultrasonic Mouser\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -d {left,right,up,down}, --direction {left,right,up,down}\n                        the direction the sensor is pointing across the screen (default: up)\n  -r, --recalibrate     recalibrate the sensor to the screen\n  -c, --clicky          auto-click repeatedly while interacting\n  -b, --bounds          choose the on-screen bounds for auto-clicking\n\n```\n\n# Todo\n\n* Fully support horizontal mode\n\n\t* Separate calibration configurations\n\n\n* Configure on-screen boundaries\n\t\n\t* Listen to mouse events to let the user draw a line to define the boundaries\n\t\n\t* Add to configuration (config.ini)\n\n\n* Smoothing\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1j01%2Fnxt-ultrasonic-mouser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1j01%2Fnxt-ultrasonic-mouser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1j01%2Fnxt-ultrasonic-mouser/lists"}