The bang protocol is a compact message format that is easy for embedded systems to parse. Bang protocol messages begin with an exclamation mark (`!‘) and end with a carriage return (‘\r‘) and, optionally, a new-line (‘\n‘). Between these delimiters, the message begins with a command and optionally includes one or more parameters. Parameters are separated by spaces (‘ ‘). Here is a simple command with a single parameter formatted using the bang protocol:

Serial command anatomy

A bang-protocol command is made up of four parts.

Messages can have no parameters: !StartMotor\r\n, or several parameters: !SetConfig 12 45 10\r\n.

Use MegunoLink’s interface panel visualizer to send commands with the bang protocol and our Arduino command handler library to decode and process them.

Start typing and press Enter to search