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
Example
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 Joystick Controller

This protocol shows information of an analog joystick connected to the microcontroller. ONLY IF the status of the joystick changes, the device sends a 'joystick_changed' event to the .Net.

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

I. "Welcome" message

Example

//Analog Joystick
c=welcome&type=OzAnalogJoystickController&pos=2&id=AAA000&t=2

Parameters

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

"reset_joystick" command

Resets the centerpoint of the joystick on the microcontroller's end. You should only reset your joystick if it is not used.

Example

c=reset_joystick&id=AAA000&t=1

Parameters

Parameter Type Range Functionality
c String "reset_joystick" 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

Sends a response if the joystick reset has been completed.

Example

c=reset_resp&id=AAA000&t=3
Parameter Type Range Functionality
c String "reset_resp" 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 events and responses sent combined. Counts from 0 to 255 then from 0 again.



III. Event from the microcontroller

"joystick_changed" event

This event is called if the joystick moves or the top button is pressed or released.

Example

c=joystick_changed&x=112&y=164&button=1&id=AAA000&t=4

Parameters

Parameter Type Range Functionality
c String "joystick_changed" Identifies the command.
x Byte 0 to 255 The x coordinate of the current position.
y Byte 0 to 255 The y coordinate of the current position.
button Bool 0,1 Button's state. 1 if pressed, 0 if released.
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 > OzAnalogJoystickController
Page: 1569