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
OzAnalogSensor
OzBatteryController
OzBuzzerController
OzButtonController
OzDCMotorControllerL298N
OzDHTController
OzDoorphoneController
OzEEPROMManager
OzGyroscopeSensor
OzIDManager
OzLCDController
OzNfcController
OzOpticalGateController
OzRegisterController
OzRGBLedController
OzRotaryController
OzServoController
OzStepCounter
OzStepperMotorMultiController
OzSwitchController
OzTemperatureController
OzTimer
OzUltrasonicSensor
Examples
Bootloader
Company


Oz Analog Sensor

Each analog sensor device can measure a single analog pin.
You can install multiple devices on a microcontroller.

I. "Welcome" event from microcontroller

Example

//Analog Joystick
c=welcome&type=OzAnalogSensor&pos=2&id=knRJ67&t=2

Parameters

Parameter Type Range Functionality
c String "welcome" Identifies the welcome message.
type String "OzAnalogSensor" Determines the type of the device.
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!
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.



II. Command from .Net

"getvalue" command

You can request the pin value of the device.

Example

c=getvalue&id=knRJ67&t=0

Parameters

Parameter Type Range Functionality
c String "getvalue" Identifies the command.
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 commands sent. Counts from 0 to 255 then from 0 again.

Response

Responds the current value of the pin connected to the Oz Analog Sensor Device.

Example

c=getvalue_resp&value=62&id=knRJ67&t=3
Parameter Type Range Functionality
c String "getvalue_resp" Identifies the response
value Double 0.00-1023.00 The digital value of the measured pin.
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.



"repchange" command

Sets threshold compared to the last measured value, so a "change" event is sent every time it passes the threshold in one of the directions. If it is set to 0 it is turned off.

Example

c=repchange&value=5.00&id=knRJ67&t=1

Parameters

Parameter Type Range Functionality
c String "repchange" Identifies the command.
value Double 0.00-1023.00
(The range of the ADC.)
Sets measurement threshold value compared to the last measured value. If it is set to 0 than the "change" event is turned off.
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 commands sent. Counts from 0 to 255 then from 0 again.

Response

Responds if the threshold value has been set.

Example

c=repchange_resp&value=5.00&id=knRJ67&t=4

Parameters

Parameter Type Range Functionality
c String "repchange_resp" Identifies the response.
value Double 0.00-1023.00 The measurement threshold value to trigger a "change" event has been set. If it is set to 0 than the "change" event is turned off.
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.



"repabove" command

Triggers an "above" event every time the digital pin value passes the value you set with this command.

Example

c=repabove&value=655.00&id=knRJ67&t=2

Parameters

Parameter Type Range Functionality
c String "repabove" Identifies the command.
value Double 0.00-1023.00
(The range of the ADC.)
If the measured value of the pin crosses this value than an "above" event is triggered.
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 commands sent. Counts from 0 to 255 then from 0 again.

Response

Responds if the above value has been set.

Example

c=repabove_resp&value=655.00&id=knRJ67&t=5

Parameters

Parameter Type Range Functionality
c String "repabove_resp" Identifies the response.
value Double 0.00-1023.00 If the measured value of the pin crosses this value than an "above" event is triggered.
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.



"repbelow" command

Triggers a "below" event every time the digital pin value passes the value you set with this command.

Example

c=repbelow&value=133.00&id=knRJ67&t=3

Parameters

Parameter Type Range Functionality
c String "repabove" Identifies the command.
value Double 0.00-1023.00
(The range of the ADC.)
If the measured value of the pin crosses this value than a "below" event is triggered.
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 commands sent. Counts from 0 to 255 then from 0 again.

Response

Responds if the below value has been set.

Example

c=repbelow_resp&value=133.00&id=knRJ67&t=6

Parameters

Parameter Type Range Functionality
c String "repbelow_resp" Identifies the response.
value Double 0.00-1023.00 If the measured value of the pin crosses this value than a "below" event is triggered.
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

"change" event

This event is called if the signal value has changed more then the threshold set with the "repchange" command. This event can show the current value of the OzAnalogDevice.

Example

c=change&value=112.00&id=knRJ67&t=7

Parameters

Parameter Type Range Functionality
c String "change" Identifies the event.
value Double 0.00-1023.00 The current value of the pin. It is the value measured after it has passed the threshold.
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.

"above" event

This event is called if the signal value has crossed above a preset value which you can set with the "repabove" command.

Example

c=above&value=655.00&id=knRJ67&t=8

Parameters

Parameter Type Range Functionality
c String "above" Identifies the event.
value Double 0.00-1023.00 The current value of the pin. It is the value measured after it has crossed the above value that has been set.
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.

"below" event

This event is called if the signal value has crossed above a preset value which you can set with the "repbelow" command.

Example

c=above&value=133.00&id=knRJ67&t=9

Parameters

Parameter Type Range Functionality
c String "below" Identifies the event.
value Double 0.00-1023.00 The current value of the pin. It is the value measured after it has crossed the below value that has been set.
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.
Copyright © 2000- - Ozeki Informatics Ltd. | info@ozeki.hu | Tel: +36 1 371 0150
Home > Technology > Robotics > Building robot software > Introduction/Protocols > DeviceHandlers > OzAnalogSensor
Page: 2969