Skip to content

Commit

Permalink
Add basic WH-C06 functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevie-Ray committed Aug 19, 2024
1 parent d25359b commit 591739c
Show file tree
Hide file tree
Showing 24 changed files with 295 additions and 173 deletions.
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
**Force-Sensing Climbing Training**

The objective of this project is to create a Web Bluetooth API client that can establish connections with various
Force-Sensing Hangboards / Plates / LED system boards used by climbers for strength measurement. Examples of such
hangboards include the [Griptonite Motherboard](https://griptonite.io/shop/motherboard/),
[Climbro](https://climbro.com/), [mySmartBoard](https://www.smartboard-climbing.com/),
[Entralpi](https://entralpi.com/), [Tindeq Progressor](https://tindeq.com/) or
[Weiheng WH-C06](https://weihengmanufacturer.com/products/wh-c06-bluetooth-300kg-hanging-scale/) also known as
[MAT Muscle Meter](https://www.matassessment.com/musclemeter)
Force-Sensing Hangboards / Dynamometers / Plates / LED system boards used by climbers. Examples of such tools include
the [Griptonite Motherboard](https://griptonite.io/shop/motherboard/), [Climbro](https://climbro.com/),
[mySmartBoard](https://www.smartboard-climbing.com/), [Entralpi](https://entralpi.com/),
[Tindeq Progressor](https://tindeq.com/) or
[Weiheng WH-C06](https://weihengmanufacturer.com/products/wh-c06-bluetooth-300kg-hanging-scale/) also sold as
[MAT Muscle Meter](https://www.matassessment.com/musclemeter).

And LED system boards from [Aurora Climbing](https://auroraclimbing.com/) like the
[Kilter Board](https://settercloset.com/pages/the-kilter-board),
Expand Down Expand Up @@ -92,10 +92,11 @@ available services with us.
- ✅ Griptonite Motherboard
- ✅ Tindeq Progressor
- ⏳ Entralpi (not verified)
- ⏳ Kilterboard (write only, see example)
- ⏳ Kilterboard (see example)
- ⏳ Weiheng WH-C06 / MAT Muscle Meter
- Enable: `chrome://flags#enable-experimental-web-platform-features`
- ➡️ Climbro
- ➡️ mySmartBoard
- ➡️ Weiheng WH-C06 / MAT Muscle Meter

### Features

Expand Down Expand Up @@ -134,7 +135,9 @@ A special thank you to:
- [@Phil9l](https://github.com/phil9l) for his research and providing a [blog](https://bazun.me/blog/kiterboard/) on how
to connect with the Kilter Board.
- [@1-max-1](https://github.com/1-max-1) for the docs on his Kilter Board
[simulator](https://github.com/1-max-1/fake_kilter_board).
[simulator](https://github.com/1-max-1/fake_kilter_board) that I coverted to
[hangtime-arduino-kilterboard](https://github.com/Stevie-Ray/hangtime-arduino-kilterboard).
- [sebws](https://github.com/sebw) for a [code sample](https://github.com/sebws/Crane) of the Weiheng WH-C06 App.

## Disclaimer

Expand Down
9 changes: 3 additions & 6 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import eslint from "@eslint/js"
import tseslint from "typescript-eslint"

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.strict,
...tseslint.configs.stylistic,
{},
)
export default tseslint.config(eslint.configs.recommended, ...tseslint.configs.strict, ...tseslint.configs.stylistic, {
ignores: ["**/dist"],
})
2 changes: 1 addition & 1 deletion examples/chart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@fortawesome/free-brands-svg-icons": "^6.6.0",
"@fortawesome/free-regular-svg-icons": "^6.6.0",
"@fortawesome/free-solid-svg-icons": "^6.6.0",
"@hangtime/grip-connect": "^0.3.4",
"@hangtime/grip-connect": "^0.3.5",
"chart.js": "^4.4.3"
},
"devDependencies": {
Expand Down
3 changes: 3 additions & 0 deletions examples/chart/src/devices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
Motherboard,
mySmartBoard,
Progressor,
WHC06,
battery,
connect,
disconnect,
Expand Down Expand Up @@ -93,6 +94,8 @@ export function setupDevice(
device = mySmartBoard
} else if (selectedDevice === "progressor") {
device = Progressor
} else if (selectedDevice === "whc06") {
device = WHC06
}

return connect(device, async () => {
Expand Down
2 changes: 1 addition & 1 deletion examples/chart/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if (appElement) {
<option value="climbro" disabled>Climbro</option>
<option value="entralpi">Entralpi</option>
<option value="motherboard">Motherboard</option>
<option value="musclemeter" disabled>Muscle Meter</option>
<option value="whc06">WH-C06</option>
<option value="smartboard" disabled>mySmartBoard</option>
<option value="progressor">Progressor</option>
</select>
Expand Down
2 changes: 1 addition & 1 deletion examples/flappy-bird/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"@hangtime/grip-connect": "^0.3.4"
"@hangtime/grip-connect": "^0.3.5"
},
"devDependencies": {
"typescript": "^5.5.4",
Expand Down
15 changes: 14 additions & 1 deletion examples/flappy-bird/src/game.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
import { Motherboard, Progressor, Entralpi, connect, notify, stream, stop, isConnected } from "@hangtime/grip-connect"
import {
Motherboard,
Progressor,
Entralpi,
WHC06,
connect,
notify,
stream,
stop,
isConnected,
} from "@hangtime/grip-connect"
import type { Device } from "@hangtime/grip-connect/src/types/devices"
import type { massObject } from "@hangtime/grip-connect/src/types/notify"

Expand Down Expand Up @@ -31,6 +41,9 @@ export function setupDevice(element: HTMLSelectElement) {
if (selectedDevice === "progressor") {
device = Progressor
}
if (selectedDevice === "whc06") {
device = WHC06
}
getBluetoothData()
})
}
Expand Down
2 changes: 1 addition & 1 deletion examples/flappy-bird/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if (controllerElement) {
<option value="climbro" disabled>Climbro</option>
<option value="entralpi">Entralpi</option>
<option value="motherboard">Motherboard</option>
<option value="musclemeter" disabled>Muscle Meter</option>
<option value="whc06">WH-C06</option>
<option value="smartboard" disabled>mySmartBoard</option>
<option value="progressor">Progressor</option>
</select>
Expand Down
2 changes: 1 addition & 1 deletion examples/kilter-board/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"@hangtime/grip-connect": "^0.3.4"
"@hangtime/grip-connect": "^0.3.5"
},
"devDependencies": {
"typescript": "^5.5.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/pong/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"@hangtime/grip-connect": "^0.3.4"
"@hangtime/grip-connect": "^0.3.5"
},
"devDependencies": {
"typescript": "^5.5.4",
Expand Down
15 changes: 14 additions & 1 deletion examples/pong/src/game.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
import { Motherboard, Progressor, Entralpi, connect, notify, stream, stop, isConnected } from "@hangtime/grip-connect"
import {
Motherboard,
Progressor,
Entralpi,
WHC06,
connect,
notify,
stream,
stop,
isConnected,
} from "@hangtime/grip-connect"
import type { Device } from "@hangtime/grip-connect/src/types/devices"
import type { massObject } from "@hangtime/grip-connect/src/types/notify"

Expand Down Expand Up @@ -31,6 +41,9 @@ export function setupDevice(element: HTMLSelectElement) {
if (selectedDevice === "progressor") {
device = Progressor
}
if (selectedDevice === "whc06") {
device = WHC06
}
getBluetoothData()
})
}
Expand Down
2 changes: 1 addition & 1 deletion examples/pong/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if (controllerElement) {
<option value="climbro" disabled>Climbro</option>
<option value="entralpi">Entralpi</option>
<option value="motherboard">Motherboard</option>
<option value="musclemeter" disabled>Muscle Meter</option>
<option value="whc06">WH-C06</option>
<option value="smartboard" disabled>mySmartBoard</option>
<option value="progressor">Progressor</option>
</select>
Expand Down
58 changes: 26 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
],
"dependencies": {
"@grip-connect/docs": "*",
"@hangtime/grip-connect": "^0.3.4"
"@hangtime/grip-connect": "^0.3.5"
},
"devDependencies": {
"@eslint/js": "^9.9.0",
"@types/eslint__js": "^8.42.3",
"@types/node": "^20.16.0",
"@types/node": "^20.16.1",
"@types/web-bluetooth": "^0.0.20",
"eslint": "^9.9.0",
"prettier": "^3.3.3",
Expand Down
Loading

0 comments on commit 591739c

Please sign in to comment.