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
OzGyroControllerMPU6050
OzIDManager
OzLCDController
OzNfcController
OzOpticalGateController
OzRegisterController
OzRGBLedController
OzRotaryController
OzServoController
OzStepCounter
OzStepperMotorMultiController
OzSwitchController
OzTemperatureController
OzTimer
OzUltrasonicController
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" message

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 pin value at any time.

Example

c=getValue&id=knRJ67&t=1

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 OzDevice..

Example

c=getValue_resp&value=62&id=knRJ67&t=3
Parameter Type Range Functionality
c String "getValue_resp" Identifies the response
value Int 0-1023 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.



"setthreshold" command

Set the threshold compared to the last measured value, so a "sigValueChange" 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=setthreshold&value=5.00&id=knRJ67&t=2

Parameters

Parameter Type Range Functionality
c String "setthreshold" Identifies the command.
threshold Double 0.00-1023.00 (it has no reason to be more) The set measurement threshold value compared to the last "getValue_resp" or "sigValueChange" event. If it is set to 0 then the "sigValueChange" 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=setthreshold_resp&value=5.00&id=knRJ67&t=4

Parameters

Parameter Type Range Functionality
c String "setthreshold_resp" Identifies the response.
threshold Double 0.00-1023.00 (it has no reason to be more) The measurement threshold value 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.



III. Event from the microcontroller

"sigValueChange" event

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

Example

c=sigValueChange&value=112&id=knRJ67&t=5

Parameters

Parameter Type Range Functionality
c String "sigValueChange" Identifies the event.
value Int 0-1023 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.
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