{"id":13672266,"url":"https://github.com/junjunjd/rustymind","last_synced_at":"2025-04-27T21:32:33.616Z","repository":{"id":49934744,"uuid":"368428594","full_name":"junjunjd/rustymind","owner":"junjunjd","description":"A driver, parser and real time brainwave plotter for NeuroSky MindWave EEG headset","archived":false,"fork":false,"pushed_at":"2022-04-25T21:24:21.000Z","size":795,"stargazers_count":49,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-08T04:04:41.768Z","etag":null,"topics":["bci","brain","brain-computer-interface","brainwave","eeg","eeg-headset","eeg-readings","eeg-signals-processing","mindwave","neuroscience","neurosky","plot","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/junjunjd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-18T06:47:24.000Z","updated_at":"2025-03-18T09:00:09.000Z","dependencies_parsed_at":"2022-09-26T16:31:14.977Z","dependency_job_id":null,"html_url":"https://github.com/junjunjd/rustymind","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junjunjd%2Frustymind","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junjunjd%2Frustymind/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junjunjd%2Frustymind/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junjunjd%2Frustymind/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/junjunjd","download_url":"https://codeload.github.com/junjunjd/rustymind/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251212557,"owners_count":21553480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bci","brain","brain-computer-interface","brainwave","eeg","eeg-headset","eeg-readings","eeg-signals-processing","mindwave","neuroscience","neurosky","plot","rust"],"created_at":"2024-08-02T09:01:30.759Z","updated_at":"2025-04-27T21:32:33.255Z","avatar_url":"https://github.com/junjunjd.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# rustymind\n\n[![crates.io](https://img.shields.io/crates/v/rustymind.svg?style=flat-square)](https://crates.io/crates/rustymind)\n[![api_doc](https://img.shields.io/badge/doc-api-blue)](https://docs.rs/rustymind)\n\nRustymind is a driver and parser for NeuroSky MindWave EEG headset written in pure Rust. You can use it to connect, interact, and plot real time brainwave data measured from the headset.\n\nThe parser is based on the [mindwave mindset communication protocols](./docs) published by NeuroSky.\n\nSee below for a screenshot of real time mindwaves plotted by `rustymind-plot` CLI based on `rustymind` parser.\n\n![Real time plot screenshot](./docs/plot_demo.png)\n\n## Getting Started\n\n`rustymind-plot` takes two arguments to run:\n\n- MindWave device path. On Mac, the path would be in the format of `/dev/tty.usbserial-10000`\n- Headset ID (printed inside the battery case)\n\n```sh\ncargo run --bin rustymind-plot \"/dev/tty.usbserial-10000\" a05f\n```\n\nIf you don't pass in the headset ID argument, the dongle will auto-connect to any headsets it can find.\n\nTo use `rustymind` as a library, you need to use `connect_headset` function and `Parser` struct. For example:\n\n```rust\nuse rustymind::{connect_headset, PacketType, Parser};\n\nlet mut port = connect_headset(\"/dev/tty.usbserial-10000\", b\"\\xa0\\x5f\")?;\nlet mut buffer: Vec\u003cu8\u003e = vec![0; 2048];\nlet mut parser = Parser::new();\n\nloop {\n    let bytes_read = port.read(buffer.as_mut_slice()).unwrap();\n    for i in 0..bytes_read {\n        if let Some(x) = parser.parse(buffer[i]) {\n            for r in x {\n                match r {\n                    PacketType::Attention(value) =\u003e {\n                        println!(\"Attention value = {}\", value);\n                    }\n                    PacketType::Meditation(value) =\u003e {\n                        println!(\"Meditation value = {}\", value);\n                    }\n                    PacketType::AsicEeg(value) =\u003e {\n                        println!(\"EEG power values = {:?}\", value);\n                    }\n                    _ =\u003e (),\n                }\n            }\n        }\n    }\n}\n```\n\nThis software is not intended to be used in medical diagnostics or medical\ntreatment.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunjunjd%2Frustymind","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjunjunjd%2Frustymind","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunjunjd%2Frustymind/lists"}