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


OzOpticalGateController

This protocol controls an infrared optical gate connected to the microcontroller.

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

I. "Welcome" event from microcontroller

Example

c=welcome&id=4dgbhf&type=OzOpticalGateController&pos=2&t=3

Parameters

Parameter Type Range Functionality
c String "welcome" Identifies the welcome message.
type String "OzOpticalGateController" Determines the type of the devicehandler.
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.
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. Commands to microcontroller

"Set Infra" command

With this command you can turn on/off the optical gate.

Example

c=setinfra&state=1&t=0&id=4dgbhf

Parameters

Parameter Type Range Functionality
c String "setinfra" Identifies the command.
state Bool 0,1 0 means "Turn Off" the infra, 1 means "Turn On" the infra
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=setinfra_resp&state=1&photo=1&id=4dgbhf&t=3

Parameters

Parameter Type Range Functionality
c String "setinfra_resp" Identifies the response.
state Bool 0,1 State of the infra: 0 means "Turned Off", 1 means "Turned On"
photo Bool 0,1 1 if an object covers the infra and 0 if not. (see:OzekiButtonController)
t Byte 0-255 Counts the number of events and responses sent combined. 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.



III. Event from microcontroller

"Infra Changed" Event

This event is called if the optical gate's photo parameter has changed.

c=infrachanged&id=4dgbhf&t=4&state=1&photo=1

Parameters

Parameter Type Range Functionality
c String "infrachanged" Identifies the event.
state Bool 0,1 State of the infra: 0 means "Turned Off", 1 means "Turned On"
photo Bool 0,1 1 if an object covers the infra and 0 if not. (see:OzekiButtonController)
t Byte 0-255 Counts the number of events and responses sent combined. 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.
Copyright © 2000- - Ozeki Informatics Ltd. | info@ozeki.hu | Tel: +36 1 371 0150
Home > Technology > Robotics > Building robot software > Introduction/Protocols > DeviceHandlers > OzOpticalGateController
Page: 1605