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
Example
OzDCMotorControllerL298N
OzDHTController
OzDoorphoneController
OzEEPROMController
OzKeyboardController
OzGyroscopeSensor
OzIDManager
OzIRTransceiver
OzLCDController
OzNfcReader
OzOpticalGateController
OzRegisterManipulation
OzRF24Transceiver
OzRGBLEDController
OzRotaryController
OzServoController
OzStepCounter
OzStepperMotorMultiController
OzSwitchController
OzTemperatureController
OzTimer
OzUltrasonicSensor
Examples
Bootloader
Company


OzButtonController

OzButtonController uses a protocol to check the status of any button wired to the microcontroller.

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

I. "Welcome" event from microcontroller

Example

c=welcome&type=OzButtonController&id=A47vvH&pos=2&t=3

Parameters

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

"EnablePullup" command

Adds resistor to button pin by setting it HIGH. It is used if there is a problem with the button. Malfunctions can happen if the button is not grounded.

c=enablepullup&state=1&id=A47vvH&t=0

Parameters

Parameter Type Range Functionality
c String "enablepullup" Identifies the command.
state Bool 0,1 With 1 you can pullup the input, 0 sets it back to low state. If the button is in perfect condition it should work in both states.
id String 6 characters (numbers, uppercase and lowercase characters) Identifies the device. The ID is never changed during communication.
t Byte 0-255 Counts the number of commands. Counts from 0 to 255 then from 0 again.

Response

c=enablepullup_resp&state=1&id=A47vvH&t=4

Parameters

Parameter Type Range Functionality
c String "enablepullup_resp" Identifies the event.
state Bool 0,1 If 1 the input is pulled up, if 0 then the input is set to low. If the button is in perfect condition it should work in both states.
id String 6 characters (numbers, uppercase and lowercase characters) The ID of the IDManager.
t Byte 0-255 Counts the number of events and responses sent combined. Counts from 0 to 255 then from 0 again.

"GetState" command

This command returns the actual state of the connected button.

c=getstate&id=A47vvH&t=1

Parameters

Parameter Type Range Functionality
c String "getstate" Identifies the command.
id String 6 characters (numbers, uppercase and lowercase characters) Identifies the device. The ID is never changed during communication.
t Byte 0-255 Counts the number of commands sent. Counts from 0 to 255 then from 0 again.

Response

c=getstate_resp&state=1&id=A47vvH&t=5

Parameters

Parameter Type Range Functionality
c String "getstate_resp" Identifies the response.
state Bool 0,1 It is the actual state of the button. 0 means LOW STATE, 1 means HIGH STATE.
id String 6 characters (numbers, uppercase and lowercase characters) The ID of the IDManager.
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

There are currently no events, but in older version there was a "ButtonStateChange" event.

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