Products
Technology
SMS solutions
PBX systems
Databases
Robotics
Building robot hardware
Building electronics
Building robot software
Introduction/Protocols
Architecture
How to develop a devhandler
Line protocol
DeviceHandlers
Oz433Mhz Transceiver
OzAnalogJoystickController
OzBatteryController
OzBuzzerController
OzButtonController
OzDCMotorControllerL298N
OzDHTController
OzDoorphoneController
OzEEPROMManager
OzGyroControllerMPU6050
OzIDManager
OzLCDController
OzNfcController
OzOpticalGateController
OzRegisterController
OzRGBLedController
OzRotaryController
OzServoController
OzStepCounter
OzStepperMotorMultiController
OzSwitchController
Example
OzTemperatureController
OzTimer
OzUltrasonicController
Examples
Bootloader
Company


Oz Switch Controller

This protocol helps you to control device's state or intensity. You can turn on or off the device or you can define the device's PWM. For example you can set the brightness of a led by changing the pwm.

How to build a test circuit with a LED and an arduino mega?
Arduino codes are included.

I. "Welcome" message

c=welcome&type=OzSwitchController&id=IqlZci&pos=2&t=2

Parameters

Parameter Type Range Functionality
c String "welcome" Identifies the welcome message.
type String "OzSwitchController" 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 devices on the same position on the same microcontroller!
t Byte 0-255 Counts the number of events and responses sent combined. Counts from 0 to 255 then from 0 again.



II. Commands from .Net

"Switch On/Off" command

With this command you can change the status of the switch to HIGH or LOW state.

Example

//Turn On
c=setswitch&state=1&t=0&id=IqlZci
//Turn Off c=setswitch&state=0&t=1&id=IqlZci

Parameters

Parameter Type Range Functionality
c String "setswitch" Identifies the command.
state Bool 0,1 It is the actual state of the button. 0 means LOW STATE, 1 means HIGH STATE.
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

//Turn On Response
c=setswitch_resp&state=3&pwm=0&id=IqlZci&t=0
//Turn Off Response c=setswitch_resp&state=4&pwm=0&id=IqlZci&t=1

Parameters

Parameter Type Range Functionality
c String "setswitch_resp" Identifies the response.
state Bool 0,1 It is the actual state of the button. 0 means LOW STATE, 1 means HIGH STATE.
pwm ushort 0-1023 Pulse-width modulation value.
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.



"PWM change" command

With this command you can change value of the PWM

Example

c=setswitch&pwm=204&t=2&id=IqlZci

Parameters

Parameter Type Range Functionality
c String "setswitch" Identifies the command.
pwm Ushort 0-1023 Pulse-width modulation value.
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=setswitch_resp&state=0&pwm=204&id=IqlZci&t=5

Parameters

Parameter Type Range Functionality
c String "setswitch_resp" Identifies the response.
state Bool 0,1 It is the actual state of the button. 0 means LOW STATE, 1 means HIGH STATE.
pwm Ushort 0-1023 Pulse-width modulation value.
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 Arduino

None



Copyright © 2000- - Ozeki Informatics Ltd. | info@ozeki.hu | Tel: +36 1 371 0150
Home > Technology > Robotics > Building robot software > Introduction/Protocols > DeviceHandlers > OzSwitchController
Page: 1577