Arduino Buzzer Protocol
This protocol controls a buzzer connected to the microcontroller. Buzzers are capable to play different tones and sequentially combine tones to create music. This protocol contains an easy command to achieve this.
How to build a test circuit with a buzzer and an Arduino Mega?
Arduino codes are included.
I. "Welcome" event from microcontroller
Example
c=welcome&id=A47vvH&type=OzBuzzerController&pos=2&t=3
Parameters
Parameter | Type | Range | Functionality |
c | String | "welcome" | Identifies the welcome message. |
type | String | "OzBuzzerController" | Determines the type of the device. |
id | String | 6 characters (numbers, uppercase and lowercase characters) | The ID of the device which is chosen by the microcontroller. |
pos | Byte | 0-255 | Determines the position of the device on the list of the ID manager of the microcontroller. Please make sure there are no other devices in the same position. |
t | Byte | 0-255 | Counts the number of events and responses sent combined. Counts from 0 to 255 then from 0 again. |
II. Command to microcontroller
"Set Buzz" command
This command orders the buzzer to beeping sound with a frequency and duration provided in the parameters. If the duration is not given than the tone will not change until new command.
Example
c=setbuzz&freq=300&length=1000&t=0&id=A47vvH
Parameters
Parameter | Type | Range | Functionality |
c | String | "setbuzz" | Identifies the command. |
freq | Ushort | 0-65535 | Frequency of the sound. |
length | Ushort | 0-65535 (optional parameter) |
Duration given in millisec. If not given the tone will not change until new command. |
t | Byte | 0-255 | Counts the number of commands sent. Counts from 0 to 255 then from 0 again. |
id | String | 6 characters (numbers, uppercase and lowercase characters) | Identifies the device. The ID is never changed during communication. |
Response
If tone duration was specified than this response will arrive after the tone.
c=setbuzz_resp&id=A47vvH&freq=300&length=1000&t=3
Parameters
Parameter | Type | Range | Functionality |
c | String | "setbuzz_resp" | Identifies the response. |
freq | Ushort | 0-65535 | Frequency of the sound. |
length | Ushort | 0-65535(optional parameter) | Duration given in millisec. If not given the tone will not change until new command. |
t | Byte | 0-255 | Counts the number of events and responses sent combined. Counts from 0 to 255 then from 0 again. |
id | String | 6 characters (numbers, uppercase and lowercase characters) | Identifies the device. The ID is never changed during communication. |
III. Event from microcontroller
None
More information
- RF 433 MHz Transceiver serielles Protokoll
- Analoger Joystick serielles Protokoll
- Analogsensor serielles Protokoll
- Taste serielles Protokoll
- Summer serielles Protokoll
- Gleichstrommotor serielles Protokoll
- DHT-Sensor serielles Protokoll
- EEPROM serielles Protokoll
- Tastatur serielles Protokoll
- Gyroskop-Sensor serielles Protokoll
- ID-Manager serielles Protokoll
- IR-Transceiver serielles Protokoll
- LCD-Display serielles Protokoll
- NFC-Lesegerät serielles Protokoll
- Optisches Tor serielles Protokoll
- Register
- RF24-Transceiver serielles Protokoll
- RGB-LED serielles Protokoll
- RGB-Sensor serielles Protokoll
- Drehgeber serielles Protokoll
- Servomotor serielles Protokoll
- Schrittzähler serielles Protokoll
- Schrittmotor serielles Protokoll
- Schalter serielles Protokoll
- Temperatursensor serielles Protokoll
- Timer serielles Protokoll
- Ultraschallsensor serielles Protokoll
- Willkommensnachrichten des Ozeki 3D-Druckers