connect PaSoRi as
Shows the WebUSB device picker and assigns the selected reader to a name such as `left` or `right`.
Complete block reference (5 blocks)
TurboWarp NFC input
Connect Sony PaSoRi readers under project-local names, read NFC card IDm and PMm values, and write IDm values into Temporary Variables.
Open the user guide at https://kubohiroya.github.io/turbowarp-webusb-pasori/.
pnpm add --save-exact @kubohiroya/turbowarp-webusb-pasori@0.7.0
https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-webusb-pasori@0.7.0/dist/webusb-pasori.jsShows the WebUSB device picker and assigns the selected reader to a name such as `left` or `right`.
Polls a named reader until a card is present and stores its IDm.
Reports the most recent IDm read by a named reader.
Unsandboxed extensions can read `Scratch.vm.runtime.ext_kubohiroyawebusbpasori`.
const left = await pasori.connectPasori({readerId: 'left'});
await pasori.connectPasori({readerId: 'right'});
const card = await left.readCardInfo();
const idm = await pasori.waitForNfcIdm({readerId: 'left', signal});This extension is intentionally scoped to Sony PaSoRi card ID reading. WebUSB requires a secure context, browser support, a user gesture, and device permission. Some operating system drivers or browser protected-interface rules can prevent `claimInterface(0)` from succeeding.
Manual hardware demo. Hardware success is unverified; see README requirements. No audio.
All 5 blocks are documented below, including compatibility blocks and blocks available through optional features. Select a block to read its behavior, arguments, default values, and menu choices. Each block has a permanent link.
connect PaSoRi as [READER_ID]Requests permission and connects a Sony PaSoRi reader over WebUSB with a project-local reader name.
Block type: COMMAND. Opcode: connectPasoriBlock. Permanent link
| Argument | Type | Default value | Menu choices |
|---|---|---|---|
READER_ID | STRING | default |
wait for NFC card on PaSoRi [READER_ID] set runtime var [RUNTIME_VAR] to IDmWaits until a card is read on the named PaSoRi and stores its IDm in a runtime variable.
Block type: COMMAND. Opcode: waitForNfcIdmSetRuntimeVar. Permanent link
| Argument | Type | Default value | Menu choices |
|---|---|---|---|
READER_ID | STRING | default | |
RUNTIME_VAR | STRING | nfcIdm |
wait for NFC card on PaSoRi [READER_ID] set runtime var [RUNTIME_VAR] to IDm and broadcast [MESSAGE]Waits until a card is read on the named PaSoRi, stores its IDm, and broadcasts a message.
Block type: COMMAND. Opcode: waitForNfcIdmSetRuntimeVarAndBroadcast. Permanent link
| Argument | Type | Default value | Menu choices |
|---|---|---|---|
READER_ID | STRING | default | |
RUNTIME_VAR | STRING | nfcIdm | |
MESSAGE | STRING | nfcScanned |
last NFC IDm on PaSoRi [READER_ID]Returns the most recent NFC IDm read by the named PaSoRi.
Block type: REPORTER. Opcode: lastIdmReporter. Permanent link
| Argument | Type | Default value | Menu choices |
|---|---|---|---|
READER_ID | STRING | default |
connected PaSoRi countReturns the number of PaSoRi readers connected through this extension.
Block type: REPORTER. Opcode: connectedPasoriCount. Permanent link
This block has no arguments.
カードを大きくし、カード内のNFC表記を読みやすくしました。一覧とブロックのアイコンに同じ図案を使います。拡張ID・ブロック・実行方法は変わりません。