-
Notifications
You must be signed in to change notification settings - Fork 115
spec digital write square wave
Ken Sharp edited this page Dec 10, 2025
·
2 revisions
Writes a square wave with the specified frequency to the specified DO channel.
| Digital Write Square Wave Command | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description | Writes a square wave with the specified frequency to the specified DO channel. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Size | 16 Bytes | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Format | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
| SoF : 0xFF | PACKET SIZE : 0x0E | PACKET NUM | CMD : 0x0043 | CHANNEL | FREQUENCY | Duration | CHECKSUM | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SoF | Start of Frame. Always 0xFF. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PACKET SIZE | Packet Size In Bytes | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PACKET NUM | The Current Packet Number. This value increments with each new packet. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CMD | Digital Write Square Wave Command. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CHANNEL | The DO Channel To Write To | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FREQUENCY | U32 Frequency in Hz | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Duration | U32 Duration In mS (0 = indefinitely) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CHECKSUM | Checksum. Computed by adding all of the bytes in the packet in U8 form ignoring rollover. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The device firmware is responsible for setting pin direction (input / output). A Freq of 0 should disable the output (noTone() for Arduino API)
| Digital Write Square Wave Response | ||||||||||||||||||||||||||||||||||||||||||||||||
| Description | LINX device's response to Digital Write Square Wave command | |||||||||||||||||||||||||||||||||||||||||||||||
| Size | 6 Bytes | |||||||||||||||||||||||||||||||||||||||||||||||
| Format | 0 | 1 | 2 | 3 | 4 | 5 | ||||||||||||||||||||||||||||||||||||||||||
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
| SoF : 0xFF | PACKET SIZE | PACKET NUM | STATUS | CHECKSUM | ||||||||||||||||||||||||||||||||||||||||||||
| SoF | Start of Frame. Always 0xFF. | |||||||||||||||||||||||||||||||||||||||||||||||
| PACKET SIZE | Total packet size in bytes. | |||||||||||||||||||||||||||||||||||||||||||||||
| PACKET NUM | The packet number of the packet that generated the response. | |||||||||||||||||||||||||||||||||||||||||||||||
| STATUS | See Return Status section below. | |||||||||||||||||||||||||||||||||||||||||||||||
| CHECKSUM | Checksum. Computed by adding all of the bytes in the packet in U8 form ignoring rollover. | |||||||||||||||||||||||||||||||||||||||||||||||
No function specific statuses. See Return Status for universal return statuses.