Component: IrDA (EB012, MCP1250, MCP2120) (Wireless)
From Flowcode Help
Jump to navigationJump to searchAuthor | Matrix Ltd. |
Version | 2.0 |
Category | Wireless |
Contents
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. IrDA Transmit
Receive
Basic example which waits for any incoming data and then displays the data on the LCD. IrDA Receive
Downloadable macro reference
SendChar | |
Sends a byte character to the IrDA connection. | |
[[File:]] - | Char |
- VOID | Return |
ReceiveChar | |
Receives byte character from the IrDA connection. | |
[[File:]] - | Timeout |
Max amount of time in milliseconds to wait for data. | |
[[File:]] - | Return |
Initialise | |
Initialises the UART ready for IrDA data to be sent or received, | |
- VOID | Return |
GetTarget | |
Gets the target handle the property links to | |
[[File:]] - | Return |
GetState | |
Returns true if the button is depressed, else false | |
[[File:]] - | Return |
Register | |
Adds the object to the list if not already there | |
[[File:]] - | Target |
- VOID | Return |
SetLatchingFor | |
Sets whether the button is depressed when the mouse is released | |
[[File:]] - | Target |
[[File:]] - | Enabled |
- VOID | Return |
SetMode | |
Sets the animation mode for the button | |
- BYTE | Mode |
0=User, 1=Up/Down, 2 = Lever | |
- VOID | Return |
SetEnabledPosFor | |
Sets the enabled position for an object | |
[[File:]] - | Target |
[[File:]] - | Position |
- VOID | Return |
SetPivotPosFor | |
Sets the position the lever rotates around for an object | |
[[File:]] - | Target |
[[File:]] - | Position |
- VOID | Return |
SetModeFor | |
Sets the animation mode for the button | |
[[File:]] - | Target |
The target object, 0 for 'set default' | |
- BYTE | Mode |
0=User, 1=Up/Down, 2 = Lever | |
- VOID | Return |
SetMovement | |
Sets the movement in units or PI/16 steps for the button | |
[[File:]] - | Move |
Movement to set to - default is 4 | |
- VOID | Return |
SetAxisFor | |
Sets the movement axis as an Axis_... constant | |
[[File:]] - | Target |
- BYTE | Axis |
Movement axis to set to, default 4 | |
- VOID | Return |
SetPivotPos | |
Sets the position of the object the lever rotates around | |
[[File:]] - | PositionHandle |
A handle to the position of the depressed location | |
- VOID | Return |
SetLatching | |
Sets whether the button is depressed when the mouse is released | |
[[File:]] - | Enabled |
- VOID | Return |
Unregister | |
Removes the object to the list if present | |
[[File:]] - | Target |
- VOID | Return |
SetMovementFor | |
Sets the movement in units or PI/16 steps for the button | |
[[File:]] - | Target |
[[File:]] - | Move |
Movement to set to, default 4 | |
- VOID | Return |
CardBitmap | |
Displays a monochrome bitmap read from the card on the LCD | |
- BYTE | X |
Range 0-127 | |
- BYTE | Y |
Range 0-31 | |
- STRING | Filename |
- BYTE | Return |
CardOpen | |
Attempts to open an existing file on the SD card 255=Error, 1=File not found, 0=Open OK | |
- STRING | Filename |
- BYTE | Return |
Forwards | |
Drives the robot forwards - waits for the distance to be traversed before returning | |
- UINT | Distance |
Distance in mm | |
- VOID | Return |
ReadBearing | |
Reads the compass bearing based on the degrees clockwise from magnetic north. | |
[[File:]] - | Return |
GetConsoleHandle | |
Gets the handle to the console allowing data displaying on the panel etc. | |
[[File:]] - | Return |
LCDDrawLine | |
Allows a single pixel width line to be drawn on the LCD | |
- BYTE | X1 |
X Pixel 0-127 | |
- BYTE | Y1 |
Y Pixel 0-31 | |
- BYTE | X2 |
X Pixel 0-127 | |
- BYTE | Y2 |
Y Pixel 0-31 | |
- VOID | Return |
ServoAutoMoveToPosition | |
Allows one of the servo positions to move gradually to a new position | |
- BYTE | Channel |
Range 0-3 | |
- BYTE | Position |
Range 0-255 | |
- VOID | Return |
ReadAllValue | |
Reads a single value stored from the read all command Index dictates which sensor value to read | |
- BYTE | Index |
0=SW, 1-8=IR, 9-10=Line, 11=Light, 12=Mic, 13-15=Accel | |
- UINT | Return |
LCDBacklight | |
Allows the LCD backlight brighntess to be adjusted | |
- BYTE | Intensity |
Range 0-100, 0=Off, 1=Min Brightness, 100=Max Brightness | |
- VOID | Return |
LCDDrawRect | |
Allows a rectangle to be drawn on the LCD | |
- BYTE | X1 |
X Pixel 0-127 | |
- BYTE | Y1 |
Y Pixel 0-31 | |
- BYTE | X2 |
X Pixel 0-127 | |
- BYTE | Y2 |
Y Pixel 0-31 | |
- VOID | Return |
ReadLine | |
Reads one of the IR line sensors 0-1 0=Left, 1=Right | |
- BYTE | index |
0=Left, 1=Right | |
- UINT | Return |
ServoDisable | |
Allows one of the servo outputs 0-3 to be disabled | |
- BYTE | Channel |
Range 0-3 | |
- VOID | Return |
ServoEnable | |
Allows one of the servo outputs 0-3 to be enabled | |
- BYTE | Channel |
Range 0-3 | |
- VOID | Return |
CardReadByte | |
Reads a byte from the currently open file. Starts at the beginning of the file and auto increments to the end | |
- BYTE | Return |
CardErase | |
Attempts to delete an existing file on the SD card 255=Error, 1=File not found, 0=Delete OK | |
- STRING | Filename |
- BYTE | Return |
CardWriteByte | |
Appends a byte to the end of the currently open file | |
- BYTE | Data |
- VOID | Return |
EncoderRead | |
Reads one of the motor encoder counters. Approx 0.328296mm of travel per encoder unit. | |
- BYTE | index |
0=Left, 1=Right | |
- UINT | Return |
SetMotors | |
Sets the motor speeds without feedback Range -100 to 100 | |
[[File:]] - | Left |
Range -100 to 100 | |
[[File:]] - | Right |
Range -100 to 100 | |
- VOID | Return |
Backwards | |
Drives the robot backwards - waits for the distance to be traversed before returning | |
- UINT | Distance |
Distance in mm | |
- VOID | Return |
EncoderReset | |
Resets the motor encoder counters | |
- VOID | Return |
LCDVerbose | |
Allows the LCD to automatically report the API commands as they get processed. Default - verbose on | |
- BYTE | State |
0=Off 1=On | |
- VOID | Return |
SetProp | |
Allows the COM port property to be set from a parent component. | |
- STRING | PropName |
- ULONG | PropVal |
- VOID | Return |
CardInit | |
Attempts to startup the SD card 255=No Card, 254=Init Fail, 0=Init OK | |
- BYTE | Return |
GetProp | |
Allows the property filter for the COM port list to be copied to a parent component. | |
- STRING | PropName |
- STRING | Return |
LCDClear | |
Clears the LCD | |
- VOID | Return |