Arduino Register Protocol

Reads or sets registers of the microcontroller. Registers are used for configuring the microcontroller.

How to use Register Manipulation on Arduino Mega?
Arduino codes are included.

I. "Welcome" event from microcontroller

Example

c=welcome&id=i479ZY&type=OzRegisterController&pos=2&t=3

Parameters

Parameter Type Range Functionality
c String "welcome" Identifies the welcome message.
type String "OzRegisterManipulation" 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. Commands to microcontroller

"Get register value" command

Example

c=register&regid=117&t=0&id=i479ZY

Parameters

Parameter Type Range Functionality
c String "register" Identifies the command.
regid Int 0-255 The id of the register.
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) The ID of the device which is chosen by the microcontroller.

Response

c=register_resp&regid=156&value=0&id=i479ZY&t=2

Parameters

Parameter Type Range Functionality
c String "register_resp" Identifies the response.
regid Int 0-255 The id of the register.
value Int 0-255 The value of the register.
id String 6 characters (numbers, uppercase and lowercase characters) The ID of the device which is chosen by the microcontroller.
t Byte 0-255 Counts the number of events and responses sent combined. Counts from 0 to 255 then from 0 again.



"Set register value" command

Example

c=registerset&regid=149&value=3&t=1&id=i479ZY

Parameters

Parameter Type Range Functionality
c String "registerset" Identifies the command.
regid Int 0-255 The id of the register.
value Int 0-255 The new value of the register.
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) The ID of the device which is chosen by the microcontroller.

Response

c=register_resp&regid=149&value=0&id=i479ZY&t=3

Parameters

Parameter Type Range Functionality
c String "register_resp" Identifies the response.
regid Int 0-255 The id of the register.
value Int 0-255 The new value of the register.
id String 6 characters (numbers, uppercase and lowercase characters) The ID of the device which is chosen by the microcontroller.
t Byte 0-255 Counts the number of events and responses sent combined. Counts from 0 to 255 then from 0 again.



III. Event from microcontroller

None

More information