wait for QR code set runtime var
Waits until a QR code is visible on the named camera and stores the decoded text.
Complete block reference (3 blocks)
TurboWarp QR input
TurboWarp jsQR consumes frames from Camera Source, decodes QR code text, and can target a dedicated downward-facing camera such as `qr` while TurboWarp TM uses another camera.
Waits until a QR code is visible on the named camera and stores the decoded text.
Stores the decoded text and starts a broadcast hat after the write.
Reports the most recent decoded QR text.
Unsandboxed extensions can read `Scratch.vm.runtime.ext_kubohiroyajsqr`.
const text = await jsqr.waitForQrText({cameraId: 'qr', signal});
const read = await jsqr.readFrame(frameSource); // { text, bytes, structuredAppend } or null
const textOrNull = await jsqr.scanFrame(frameSource);
`waitForQrText()` acquires the named Camera Source lease, polls frames, releases its lease, and returns the first decoded text.
Load Camera Source before jsQR. Runtime-variable blocks require the Temporary Variables extension (`lmsTempVars2`). The extension does not upload camera frames.
All 3 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.
wait for QR code on camera [CAMERA_ID] set runtime var [RUNTIME_VAR] to textWaits until a QR code is detected on the named camera and stores its text in a runtime variable.
Block type: COMMAND. Opcode: waitForQrTextSetRuntimeVar. Permanent link
| Argument | Type | Default value | Menu choices |
|---|---|---|---|
CAMERA_ID | STRING | default | |
RUNTIME_VAR | STRING | qrText |
wait for QR code on camera [CAMERA_ID] set runtime var [RUNTIME_VAR] to text and broadcast [MESSAGE]Waits until a QR code is detected on the named camera, stores its text, and broadcasts a message.
Block type: COMMAND. Opcode: waitForQrTextSetRuntimeVarAndBroadcast. Permanent link
| Argument | Type | Default value | Menu choices |
|---|---|---|---|
CAMERA_ID | STRING | default | |
RUNTIME_VAR | STRING | qrText | |
MESSAGE | STRING | qrScanned |
last QR textReturns the most recent QR text detected by this extension.
Block type: REPORTER. Opcode: lastQrTextReporter. Permanent link
This block has no arguments.