Skip to content

Commit

Permalink
Update dualsense-ts
Browse files Browse the repository at this point in the history
  • Loading branch information
nsfm committed Oct 25, 2023
1 parent a852844 commit efbfa82
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 20 deletions.
26 changes: 11 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,20 @@ It relies on the WebHID API for Dualsense controller support (USB or bluetooth),

_It's not complete, but you can [check it out at noskop.com](https://noskop.com)_

### Goals
### Current status:

- Fun to use
- Easy to use
- Open source
- There's a separate Node.js CLI tool under [cli/](./cli/) providing basic movement controls with Dualsense integration
- The browser version isn't integrated with the microscope, but there's a basic UI with Dualsense and webcam integration
- Very few features are functional

### Why?

> The want of some concise, yet sufficiently comprehensive, popular account of the Microscope, both as regards the management and manipulation of the instrument, and the varied wonders and hidden realms of beauty that are disclosed and developed by its aid.<br/>**Jabez Hogg**, _The Microscope: Its History, Construction, and Application_, 1854
> The want of some concise, yet sufficiently comprehensive, popular account of the Microscope, both as regards the management and manipulation of the instrument, and the varied wonders and hidden realms of beauty that are disclosed and developed by its aid.
>
> **Jabez Hogg**, _The Microscope: Its History, Construction, and Application_, 1854
> And the belief that many who possess microscopes are deterred from attempting any branch of original investigation solely by the great difficulty they experience surmounting elementary detail and mere mechanical operations.<br/>**Lionel Smith Beale**, _How To Work With The Microscope_, 1857
> And the belief that many who possess microscopes are deterred from attempting any branch of original investigation solely by the great difficulty they experience surmounting elementary detail and mere mechanical operations.
>
> **Lionel Smith Beale**, _How To Work With The Microscope_, 1857
In other words,

> Maybe folks would appreciate microscopes if they were more fun, and easy to use.<br/>**Lionel & Jabez**, _probably_, circa 1850
Ideally, it would be like there was _no scope_ at all.

### But where do I get the microscope?

It will need to be built from scratch. A 3D printer would be a good starting point; confirm that it responds to the tool, then swap the extruder for your objective lens and camera. Godspeed.
In other words, maybe folks would enjoy microscopes more if they were fun and easy to use. Ideally, it would feel like there was _no scope_ at all.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@blueprintjs/icons": "^4.8.0",
"@blueprintjs/popover2": "^1.7.4",
"@blueprintjs/select": "^4.8.4",
"dualsense-ts": "5.0.4",
"dualsense-ts": "5.1.8",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-full-screen": "^1.1.1",
Expand Down
8 changes: 8 additions & 0 deletions src/Controller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ export const requestPermission = (
export const ControllerContext = React.createContext(controller);
ControllerContext.displayName = "ControllerContext";

controller.hid.register((data) => {
console.group("dualsense-ts");
controller.hid.provider.setWired()
console.log(JSON.stringify(controller.hid.state, null, 2))
console.log(controller.hid.provider.wireless)
console.groupEnd();
})

controller.connection.on("change", ({ state }) => {
console.group("dualsense-ts");
console.log(`Controller ${state ? "" : "dis"}connected`);
Expand Down
1 change: 1 addition & 0 deletions src/Serial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const SerialContext = createContext<SerialContextValue>({
export const useSerial = () => useContext(SerialContext);

interface SerialProviderProps {}

export const SerialProvider = ({
children,
}: PropsWithChildren<SerialProviderProps>) => {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4016,10 +4016,10 @@ dotenv@^10.0.0:
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81"
integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==

dualsense-ts@5.0.4:
version "5.0.4"
resolved "https://registry.yarnpkg.com/dualsense-ts/-/dualsense-ts-5.0.4.tgz#5995c70bc7a22fa65f1085c030e97a42abd69630"
integrity sha512-UosocDUNklVOMcD6QxFJolB4DHk1SRS1MdTbg4Q797zdqTgLr+1Ymf8C+q49lLMNMouOI756VEtw5s9/Jw01xw==
dualsense-ts@5.1.8:
version "5.1.8"
resolved "https://registry.yarnpkg.com/dualsense-ts/-/dualsense-ts-5.1.8.tgz#e879d15eb02b86cbe5dd1d71a8c379da73e56e69"
integrity sha512-3ybIAR4/lk++agMZwKC07jCnCKF+0kpOwDHZh6+mbtfuSZCm0jy526WyrAmOcFqU5JgmFIoAzrO1418jF6j4MA==

duplexer@^0.1.2:
version "0.1.2"
Expand Down

0 comments on commit efbfa82

Please sign in to comment.