Component: IrDA (EB012, MCP1250, MCP2120) (Wireless)

From Flowcode Help
Revision as of 10:36, 17 November 2021 by Wiki bot (talk | contribs)
Jump to navigationJump to search
Author Matrix Ltd.
Version 2.0
Category Wireless


IrDA (EB012, MCP1250, MCP2120) component

Low level routines for controlling a standard IrDA interface. Also available in the form of the EB012 IrDA E-block.

Detailed description

No detailed description exists yet for this component

Examples

Transmit

Basic example which repeatedly transmits a string of data via the IrDA interface. FC6 Icon.png IrDA Transmit

Receive

Basic example which waits for any incoming data and then displays the data on the LCD. FC6 Icon.png IrDA Receive

Downloadable macro reference

Fc9-comp-macro.png SendChar
Sends a byte character to the IrDA connection. 
[[File:]] - Char
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ReceiveChar
Receives byte character from the IrDA connection. 
[[File:]] - Timeout
Max amount of time in milliseconds to wait for data. 
[[File:]] - Return


Fc9-comp-macro.png Initialise
Initialises the UART ready for IrDA data to be sent or received, 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetTarget
Gets the target handle the property links to 
[[File:]] - Return


Fc9-comp-macro.png GetState
Returns true if the button is depressed, else false 
[[File:]] - Return


Fc9-comp-macro.png Register
Adds the object to the list if not already there 
[[File:]] - Target
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetNotify
Sets the object to notify when the button is pressed or released  
[[File:]] - Handle
The handle of the object - 0 to use the caller object 
Fc9-u32-icon.png - ULONG Ident
The identifier to send in the System.Notify message 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetLatchingFor
Sets whether the button is depressed when the mouse is released 
[[File:]] - Target
 
[[File:]] - Enabled
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetMode
Sets the animation mode for the button 
Fc9-u8-icon.png - BYTE Mode
0=User, 1=Up/Down, 2 = Lever 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetEnabledPosFor
Sets the enabled position for an object 
[[File:]] - Target
 
[[File:]] - Position
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetPivotPosFor
Sets the position the lever rotates around for an object 
[[File:]] - Target
 
[[File:]] - Position
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetModeFor
Sets the animation mode for the button 
[[File:]] - Target
The target object, 0 for 'set default' 
Fc9-u8-icon.png - BYTE Mode
0=User, 1=Up/Down, 2 = Lever 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetMovement
Sets the movement in units or PI/16 steps for the button 
[[File:]] - Move
Movement to set to - default is 4 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetAxisFor
Sets the movement axis as an Axis_... constant 
[[File:]] - Target
 
Fc9-u8-icon.png - BYTE Axis
Movement axis to set to, default 4 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetPivotPos
Sets the position of the object the lever rotates around  
[[File:]] - PositionHandle
A handle to the position of the depressed location 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetAutoReset
Sets the state of the auto-reset flag If the flag is true (it is by default) then Button Helper will reset the state of each button on stop  
[[File:]] - State
Set true to reset to off on sim stop, else false to retain state 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetLatching
Sets whether the button is depressed when the mouse is released 
[[File:]] - Enabled
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Unregister
Removes the object to the list if present 
[[File:]] - Target
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetMovementFor
Sets the movement in units or PI/16 steps for the button 
[[File:]] - Target
 
[[File:]] - Move
Movement to set to, default 4 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png CardBitmap
Displays a monochrome bitmap read from the card on the LCD 
Fc9-u8-icon.png - BYTE X
Range 0-127 
Fc9-u8-icon.png - BYTE Y
Range 0-31 
Fc9-string-icon.png - STRING Filename
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png CardRecordMic
Records an audio stream on the card from the microphone 
Fc9-u8-icon.png - BYTE BitDepth
0=8-bit, 1=16-bit 
Fc9-u8-icon.png - BYTE SampleRate
Sample Rate 0=8KHz, 1=16KHz 
Fc9-u16-icon.png - UINT RecordTime
Time to record for in seconds, Range 0-65535 
Fc9-string-icon.png - STRING Filename
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png CardOpen
Attempts to open an existing file on the SD card 255=Error, 1=File not found, 0=Open OK 
Fc9-string-icon.png - STRING Filename
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png Forwards
Drives the robot forwards - waits for the distance to be traversed before returning 
Fc9-u16-icon.png - UINT Distance
Distance in mm 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ReadBearing
Reads the compass bearing based on the degrees clockwise from magnetic north. 
[[File:]] - Return


Fc9-comp-macro.png GetConsoleHandle
Gets the handle to the console allowing data displaying on the panel etc. 
[[File:]] - Return


Fc9-comp-macro.png LCDDrawLine
Allows a single pixel width line to be drawn on the LCD 
Fc9-u8-icon.png - BYTE X1
X Pixel 0-127 
Fc9-u8-icon.png - BYTE Y1
Y Pixel 0-31 
Fc9-u8-icon.png - BYTE X2
X Pixel 0-127 
Fc9-u8-icon.png - BYTE Y2
Y Pixel 0-31 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ServoAutoMoveToPosition
Allows one of the servo positions to move gradually to a new position 
Fc9-u8-icon.png - BYTE Channel
Range 0-3 
Fc9-u8-icon.png - BYTE Position
Range 0-255 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ReadAllValue
Reads a single value stored from the read all command Index dictates which sensor value to read 
Fc9-u8-icon.png - BYTE Index
0=SW, 1-8=IR, 9-10=Line, 11=Light, 12=Mic, 13-15=Accel 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png LCDBacklight
Allows the LCD backlight brighntess to be adjusted 
Fc9-u8-icon.png - BYTE Intensity
Range 0-100, 0=Off, 1=Min Brightness, 100=Max Brightness 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png LCDDrawRect
Allows a rectangle to be drawn on the LCD 
Fc9-u8-icon.png - BYTE X1
X Pixel 0-127 
Fc9-u8-icon.png - BYTE Y1
Y Pixel 0-31 
Fc9-u8-icon.png - BYTE X2
X Pixel 0-127 
Fc9-u8-icon.png - BYTE Y2
Y Pixel 0-31 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ReadLine
Reads one of the IR line sensors 0-1 0=Left, 1=Right 
Fc9-u8-icon.png - BYTE index
0=Left, 1=Right 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png ServoDisable
Allows one of the servo outputs 0-3 to be disabled 
Fc9-u8-icon.png - BYTE Channel
Range 0-3 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ServoEnable
Allows one of the servo outputs 0-3 to be enabled 
Fc9-u8-icon.png - BYTE Channel
Range 0-3 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png CardReadByte
Reads a byte from the currently open file. Starts at the beginning of the file and auto increments to the end 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png CardErase
Attempts to delete an existing file on the SD card 255=Error, 1=File not found, 0=Delete OK 
Fc9-string-icon.png - STRING Filename
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png CardWriteByte
Appends a byte to the end of the currently open file  
Fc9-u8-icon.png - BYTE Data
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png EncoderRead
Reads one of the motor encoder counters. Approx 0.328296mm of travel per encoder unit. 
Fc9-u8-icon.png - BYTE index
0=Left, 1=Right 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png SetMotors
Sets the motor speeds without feedback Range -100 to 100 
[[File:]] - Left
Range -100 to 100 
[[File:]] - Right
Range -100 to 100 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Backwards
Drives the robot backwards - waits for the distance to be traversed before returning 
Fc9-u16-icon.png - UINT Distance
Distance in mm 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png EncoderReset
Resets the motor encoder counters 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png LCDVerbose
Allows the LCD to automatically report the API commands as they get processed. Default - verbose on 
Fc9-u8-icon.png - BYTE State
0=Off 1=On 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetProp
Allows the COM port property to be set from a parent component. 
Fc9-string-icon.png - STRING PropName
 
Fc9-u32-icon.png - ULONG PropVal
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png CardInit
Attempts to startup the SD card 255=No Card, 254=Init Fail, 0=Init OK 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png GetProp
Allows the property filter for the COM port list to be copied to a parent component. 
Fc9-string-icon.png - STRING PropName
 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png LCDClear
Clears the LCD 
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Interface
Decides which IrDA interface IC we wish to communicate via. 
Fc9-type-16-icon.png Baud Options
Baud rate option selector 
Fc9-type-14-icon.png Baud Rate
 
Fc9-type-16-icon.png Data Bits
Number of data bits 
Fc9-type-16-icon.png Echo
Echo selection 
Fc9-conn-icon.png Connections
Fc9-type-16-icon.png Channel
UART Channel selector Software channels are bit banged using generic I/O pins but are not as reliable as hardware channels. Hardware channels use the selected peripheral on-board the target microcontroller. 
Fc9-type-5-icon.png TX
Pin to be used for Transmit data 
Fc9-type-5-icon.png RX
Pin to be used for Receive data 
Fc9-type-16-icon.png Use Flow Control
Flow Control (Handshake) enable or disable. On: Two I/O pins are used to control the flow of data in and out of the device. Off: Flow control is disabled. 
Fc9-conn-icon.png Simulations
Fc9-type-10-icon.png Label
Label used to help identify the component on the panel. 
Fc9-type-7-icon.png Scope Traces
Selects if the scope traces are automatically added to the data recorder window or not. Simulation - draws an approximation of the UART data onto the scope trace. ICT - sets up the scope trace for incoming data and adds UART packet decoding at the correct BAUD. 
Fc9-type-7-icon.png Console Data
Selects if the console data is automatically generated or not 
Fc9-type-21-icon.png Console Columns
Number of characters that can be displayed on a single line of the console. 
Fc9-type-16-icon.png Data Source
Simulation data source used to allow the component to connect to various remote devices Nothing - Simulation data is ignored COM port - Routes the communication data to and from a physical or virtual COM port API - Routes the communication data via a data API component on the Panel.