Jump to content

Component: Formula AllCode API (AllCode): Difference between revisions

From Flowcode Help
No edit summary
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead""
 
(6 intermediate revisions by 3 users not shown)
Line 14: Line 14:
==Formula AllCode API component==
==Formula AllCode API component==
A simulation only component to allow the Formula AllCode robot to be controlled via it's  API interface and Bluetooth data connection without having to compile or re-program the robot.
A simulation only component to allow the Formula AllCode robot to be controlled via it's  API interface and Bluetooth data connection without having to compile or re-program the robot.
==Component Source Code==
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_temp/FormulaAllCode_API.fcsx FC_Comp_Source_temp/FormulaAllCode_API.fcsx]
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_temp/FormulaAllCode_API.fcsx FC_Comp_Source_temp/FormulaAllCode_API.fcsx]


==Detailed description==
==Detailed description==
Line 73: Line 67:




The COM port for the Formula AllCode can be set via the panel properties which can be exposed to the SCADA runtime user.
===LED Control===
Controls the LEDs on the Formula AllCode by collecting the analogue value of a potentiometer on the simulation panel and sending the value to the robot.


{{Fcfile|LEDcontrol.fcfx|LED Control Example}}




===Motor Control Using Keypad===
Uses the keypad on the simulation panel to control the speed and direction of the motors. Key 2 drives the robot forwards, 8 drives backwards, 4 and 6 turn the robot on the spot.
{{Fcfile|MotorControl.fcfx|Motor Control Example}}
===Motor Control Using Joystick===
A simple example showing how to drive the Formula AllCode robot around in API mode using a panel based joystick control.
{{Fcfile|Formula_AllCode_Bluetooth.fcsx|Formula AllCode Bluetooth}}
===Proximity Alarm===
Reads the front IR sensor on the Formula AllCode from the Flowcode simulation. If a near object is sensed then the Flowcode simulation will speak the word "Hello" using the Speech component.
{{Fcfile|ProximityAlarm.fcfx|Proximity Alarm Example}}
===Driving Simulation using the API component===
An example showing how to use the API component to drive the Formula AllCode robot component on the simulation panel.
{{Fcfile|FA_API_Sim_Demo.fcfx|FA API Sim Demo}}
===JCB Bot Blog===
Blog with example code showing how to drive the Formula AllCode robot using Key Mappings and how to add extra features such as a 3D printed cover and servo motors to operate a digger arm and bucket.
[https://www.matrixtsl.com/blog/jcbbot-customising-the-formula-allcode-robot/ JCB Bot]




Line 124: Line 78:




''<span style="color:red;">No additional examples</span>''


==Macro reference==
==Macro reference==


===Backwards===
===Backwards===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Backwards'''
| width="90%" class="mtx-class-macrohead" | '''Backwards'''
|-
|-
| colspan="2" | Drives the robot backwards - waits for the distance to be traversed before returning&nbsp;
| colspan="2" | Drives the robot backwards - waits for the distance to be traversed before returning&nbsp;
Line 147: Line 102:


===CardBitmap===
===CardBitmap===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardBitmap'''
| width="90%" class="mtx-class-macrohead" | '''CardBitmap'''
|-
|-
| colspan="2" | Displays a monochrome bitmap read from the card on the LCD&nbsp;
| colspan="2" | Displays a monochrome bitmap read from the card on the LCD&nbsp;
Line 176: Line 131:


===CardCreate===
===CardCreate===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardCreate'''
| width="90%" class="mtx-class-macrohead" | '''CardCreate'''
|-
|-
| colspan="2" | Attempts to create a file on the SD card 255=Error, 1=File Already Exists, 0=Create OK&nbsp;
| colspan="2" | Attempts to create a file on the SD card 255=Error, 1=File Already Exists, 0=Create OK&nbsp;
Line 195: Line 150:


===CardErase===
===CardErase===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardErase'''
| width="90%" class="mtx-class-macrohead" | '''CardErase'''
|-
|-
| colspan="2" | Attempts to delete an existing file on the SD card 255=Error, 1=File not found, 0=Delete OK&nbsp;
| colspan="2" | Attempts to delete an existing file on the SD card 255=Error, 1=File not found, 0=Delete OK&nbsp;
Line 214: Line 169:


===CardInit===
===CardInit===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardInit'''
| width="90%" class="mtx-class-macrohead" | '''CardInit'''
|-
|-
| colspan="2" | Attempts to startup the SD card  255=No Card, 254=Init Fail, 0=Init OK&nbsp;
| colspan="2" | Attempts to startup the SD card  255=No Card, 254=Init Fail, 0=Init OK&nbsp;
Line 228: Line 183:


===CardOpen===
===CardOpen===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardOpen'''
| width="90%" class="mtx-class-macrohead" | '''CardOpen'''
|-
|-
| colspan="2" | Attempts to open an existing file on the SD card 255=Error, 1=File not found, 0=Open OK&nbsp;
| colspan="2" | Attempts to open an existing file on the SD card 255=Error, 1=File not found, 0=Open OK&nbsp;
Line 247: Line 202:


===CardPlayback===
===CardPlayback===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardPlayback'''
| width="90%" class="mtx-class-macrohead" | '''CardPlayback'''
|-
|-
| colspan="2" | Plays back a .Wav file audio stream from the card&nbsp;
| colspan="2" | Plays back a .Wav file audio stream from the card&nbsp;
Line 266: Line 221:


===CardReadByte===
===CardReadByte===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardReadByte'''
| width="90%" class="mtx-class-macrohead" | '''CardReadByte'''
|-
|-
| colspan="2" | Reads a byte from the currently open file. Starts at the beginning of the file and auto increments to the end&nbsp;
| colspan="2" | Reads a byte from the currently open file. Starts at the beginning of the file and auto increments to the end&nbsp;
Line 280: Line 235:


===CardRecordMic===
===CardRecordMic===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardRecordMic'''
| width="90%" class="mtx-class-macrohead" | '''CardRecordMic'''
|-
|-
| colspan="2" | Records an audio stream on the card from the microphone&nbsp;
| colspan="2" | Records an audio stream on the card from the microphone&nbsp;
Line 314: Line 269:


===CardWriteByte===
===CardWriteByte===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardWriteByte'''
| width="90%" class="mtx-class-macrohead" | '''CardWriteByte'''
|-
|-
| colspan="2" | Appends a byte to the end of the currently open file &nbsp;
| colspan="2" | Appends a byte to the end of the currently open file &nbsp;
Line 333: Line 288:


===EncoderRead===
===EncoderRead===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EncoderRead'''
| width="90%" class="mtx-class-macrohead" | '''EncoderRead'''
|-
|-
| colspan="2" | Reads one of the motor encoder counters. Approx 0.328296mm of travel per encoder unit.&nbsp;
| colspan="2" | Reads one of the motor encoder counters. Approx 0.328296mm of travel per encoder unit.&nbsp;
Line 352: Line 307:


===EncoderReset===
===EncoderReset===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EncoderReset'''
| width="90%" class="mtx-class-macrohead" | '''EncoderReset'''
|-
|-
| colspan="2" | Resets the motor encoder counters&nbsp;
| colspan="2" | Resets the motor encoder counters&nbsp;
Line 366: Line 321:


===Forwards===
===Forwards===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Forwards'''
| width="90%" class="mtx-class-macrohead" | '''Forwards'''
|-
|-
| colspan="2" | Drives the robot forwards - waits for the distance to be traversed before returning&nbsp;
| colspan="2" | Drives the robot forwards - waits for the distance to be traversed before returning&nbsp;
Line 385: Line 340:


===GetConsoleHandle===
===GetConsoleHandle===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetConsoleHandle'''
| width="90%" class="mtx-class-macrohead" | '''GetConsoleHandle'''
|-
|-
| colspan="2" | Gets the handle to the console allowing data displaying on the panel etc.&nbsp;
| colspan="2" | Gets the handle to the console allowing data displaying on the panel etc.&nbsp;
Line 399: Line 354:


===GetProp===
===GetProp===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetProp'''
| width="90%" class="mtx-class-macrohead" | '''GetProp'''
|-
|-
| colspan="2" | Allows the property filter for the COM port list to be copied to a parent component.&nbsp;
| colspan="2" | Allows the property filter for the COM port list to be copied to a parent component.&nbsp;
Line 418: Line 373:


===LCDBacklight===
===LCDBacklight===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDBacklight'''
| width="90%" class="mtx-class-macrohead" | '''LCDBacklight'''
|-
|-
| colspan="2" | Allows the LCD backlight brighntess to be adjusted&nbsp;
| colspan="2" | Allows the LCD backlight brighntess to be adjusted&nbsp;
Line 437: Line 392:


===LCDClear===
===LCDClear===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDClear'''
| width="90%" class="mtx-class-macrohead" | '''LCDClear'''
|-
|-
| colspan="2" | Clears the LCD&nbsp;
| colspan="2" | Clears the LCD&nbsp;
Line 451: Line 406:


===LCDDrawLine===
===LCDDrawLine===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDDrawLine'''
| width="90%" class="mtx-class-macrohead" | '''LCDDrawLine'''
|-
|-
| colspan="2" | Allows a single pixel width line to be drawn on the LCD&nbsp;
| colspan="2" | Allows a single pixel width line to be drawn on the LCD&nbsp;
Line 485: Line 440:


===LCDDrawPixel===
===LCDDrawPixel===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDDrawPixel'''
| width="90%" class="mtx-class-macrohead" | '''LCDDrawPixel'''
|-
|-
| colspan="2" | Allows a single pixel on the LCD to be set or cleared&nbsp;
| colspan="2" | Allows a single pixel on the LCD to be set or cleared&nbsp;
Line 514: Line 469:


===LCDDrawRect===
===LCDDrawRect===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDDrawRect'''
| width="90%" class="mtx-class-macrohead" | '''LCDDrawRect'''
|-
|-
| colspan="2" | Allows a rectangle to be drawn on the LCD&nbsp;
| colspan="2" | Allows a rectangle to be drawn on the LCD&nbsp;
Line 548: Line 503:


===LCDPrintNumber===
===LCDPrintNumber===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDPrintNumber'''
| width="90%" class="mtx-class-macrohead" | '''LCDPrintNumber'''
|-
|-
| colspan="2" | Prints a 16-bit signed number to the LCD&nbsp;
| colspan="2" | Prints a 16-bit signed number to the LCD&nbsp;
Line 577: Line 532:


===LCDPrintString===
===LCDPrintString===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDPrintString'''
| width="90%" class="mtx-class-macrohead" | '''LCDPrintString'''
|-
|-
| colspan="2" | Prints a string to the LCD&nbsp;
| colspan="2" | Prints a string to the LCD&nbsp;
Line 606: Line 561:


===LCDVerbose===
===LCDVerbose===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDVerbose'''
| width="90%" class="mtx-class-macrohead" | '''LCDVerbose'''
|-
|-
| colspan="2" | Allows the LCD to automatically report the API commands as they get processed. Default - verbose on&nbsp;
| colspan="2" | Allows the LCD to automatically report the API commands as they get processed. Default - verbose on&nbsp;
Line 625: Line 580:


===LEDOff===
===LEDOff===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LEDOff'''
| width="90%" class="mtx-class-macrohead" | '''LEDOff'''
|-
|-
| colspan="2" | Clears a single LED 0-7&nbsp;
| colspan="2" | Clears a single LED 0-7&nbsp;
Line 644: Line 599:


===LEDOn===
===LEDOn===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LEDOn'''
| width="90%" class="mtx-class-macrohead" | '''LEDOn'''
|-
|-
| colspan="2" | Sets a single LED 0-7&nbsp;
| colspan="2" | Sets a single LED 0-7&nbsp;
Line 663: Line 618:


===LEDWrite===
===LEDWrite===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LEDWrite'''
| width="90%" class="mtx-class-macrohead" | '''LEDWrite'''
|-
|-
| colspan="2" | Sets the value of the LEDs as an 8-bit output&nbsp;
| colspan="2" | Sets the value of the LEDs as an 8-bit output&nbsp;
Line 682: Line 637:


===Left===
===Left===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Left'''
| width="90%" class="mtx-class-macrohead" | '''Left'''
|-
|-
| colspan="2" | Rotates the robot left - waits for the angle to be traversed before returning&nbsp;
| colspan="2" | Rotates the robot left - waits for the angle to be traversed before returning&nbsp;
Line 701: Line 656:


===PlayNote===
===PlayNote===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PlayNote'''
| width="90%" class="mtx-class-macrohead" | '''PlayNote'''
|-
|-
| colspan="2" | Plays a note using the speaker on the FA&nbsp;
| colspan="2" | Plays a note using the speaker on the FA&nbsp;
Line 725: Line 680:


===ReadAllSensors===
===ReadAllSensors===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadAllSensors'''
| width="90%" class="mtx-class-macrohead" | '''ReadAllSensors'''
|-
|-
| colspan="2" | Samples all of the robot's sensors at once, storing the values locally&nbsp;
| colspan="2" | Samples all of the robot's sensors at once, storing the values locally&nbsp;
Line 739: Line 694:


===ReadAllValue===
===ReadAllValue===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadAllValue'''
| width="90%" class="mtx-class-macrohead" | '''ReadAllValue'''
|-
|-
| colspan="2" | Reads a single value stored from the read all command Index dictates which sensor value to read&nbsp;
| colspan="2" | Reads a single value stored from the read all command Index dictates which sensor value to read&nbsp;
Line 758: Line 713:


===ReadAxis===
===ReadAxis===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadAxis'''
| width="90%" class="mtx-class-macrohead" | '''ReadAxis'''
|-
|-
| colspan="2" | Reads a single X/Y/Z axis from the accelerometer sensor. &nbsp;
| colspan="2" | Reads a single X/Y/Z axis from the accelerometer sensor. &nbsp;
Line 777: Line 732:


===ReadBearing===
===ReadBearing===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadBearing'''
| width="90%" class="mtx-class-macrohead" | '''ReadBearing'''
|-
|-
| colspan="2" | Reads the compass bearing based on the degrees clockwise from magnetic north.&nbsp;
| colspan="2" | Reads the compass bearing based on the degrees clockwise from magnetic north.&nbsp;
Line 791: Line 746:


===ReadIR===
===ReadIR===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadIR'''
| width="90%" class="mtx-class-macrohead" | '''ReadIR'''
|-
|-
| colspan="2" | Reads an IR sensor 0=Left, 1=FrontLeft, 2=Front, 3=FrontRight, 4=Right, 5=RearRight,  6=Rear, 7=RearLeft&nbsp;
| colspan="2" | Reads an IR sensor 0=Left, 1=FrontLeft, 2=Front, 3=FrontRight, 4=Right, 5=RearRight,  6=Rear, 7=RearLeft&nbsp;
Line 810: Line 765:


===ReadLight===
===ReadLight===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadLight'''
| width="90%" class="mtx-class-macrohead" | '''ReadLight'''
|-
|-
| colspan="2" | Reads the light sensor 0-4095 - 4095 = Max Brightness&nbsp;
| colspan="2" | Reads the light sensor 0-4095 - 4095 = Max Brightness&nbsp;
Line 824: Line 779:


===ReadLine===
===ReadLine===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadLine'''
| width="90%" class="mtx-class-macrohead" | '''ReadLine'''
|-
|-
| colspan="2" | Reads one of the IR line sensors 0-1 0=Left, 1=Right&nbsp;
| colspan="2" | Reads one of the IR line sensors 0-1 0=Left, 1=Right&nbsp;
Line 843: Line 798:


===ReadMic===
===ReadMic===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadMic'''
| width="90%" class="mtx-class-macrohead" | '''ReadMic'''
|-
|-
| colspan="2" | Reads the microphone sensor 0 - 4095&nbsp;
| colspan="2" | Reads the microphone sensor 0 - 4095&nbsp;
Line 857: Line 812:


===ReadSwitch===
===ReadSwitch===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadSwitch'''
| width="90%" class="mtx-class-macrohead" | '''ReadSwitch'''
|-
|-
| colspan="2" | Read the switch value&nbsp;
| colspan="2" | Read the switch value&nbsp;
Line 876: Line 831:


===Right===
===Right===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Right'''
| width="90%" class="mtx-class-macrohead" | '''Right'''
|-
|-
| colspan="2" | Rotates the robot right - waits for the angle to be traversed before returning&nbsp;
| colspan="2" | Rotates the robot right - waits for the angle to be traversed before returning&nbsp;
Line 895: Line 850:


===SampleAccel===
===SampleAccel===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SampleAccel'''
| width="90%" class="mtx-class-macrohead" | '''SampleAccel'''
|-
|-
| colspan="2" | Samples the accelerometer 0 = no new data, 1 = new data available&nbsp;
| colspan="2" | Samples the accelerometer 0 = no new data, 1 = new data available&nbsp;
Line 909: Line 864:


===SampleMag===
===SampleMag===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SampleMag'''
| width="90%" class="mtx-class-macrohead" | '''SampleMag'''
|-
|-
| colspan="2" | Samples the magnetometer 0 = no new data, 1 = new data available&nbsp;
| colspan="2" | Samples the magnetometer 0 = no new data, 1 = new data available&nbsp;
Line 923: Line 878:


===ServoAutoMoveToPosition===
===ServoAutoMoveToPosition===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ServoAutoMoveToPosition'''
| width="90%" class="mtx-class-macrohead" | '''ServoAutoMoveToPosition'''
|-
|-
| colspan="2" | Allows one of the servo positions to move gradually to a new position&nbsp;
| colspan="2" | Allows one of the servo positions to move gradually to a new position&nbsp;
Line 947: Line 902:


===ServoDisable===
===ServoDisable===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ServoDisable'''
| width="90%" class="mtx-class-macrohead" | '''ServoDisable'''
|-
|-
| colspan="2" | Allows one of the servo outputs 0-3 to be disabled&nbsp;
| colspan="2" | Allows one of the servo outputs 0-3 to be disabled&nbsp;
Line 966: Line 921:


===ServoEnable===
===ServoEnable===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ServoEnable'''
| width="90%" class="mtx-class-macrohead" | '''ServoEnable'''
|-
|-
| colspan="2" | Allows one of the servo outputs 0-3 to be enabled&nbsp;
| colspan="2" | Allows one of the servo outputs 0-3 to be enabled&nbsp;
Line 985: Line 940:


===ServoSetAutoMoveSpeed===
===ServoSetAutoMoveSpeed===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ServoSetAutoMoveSpeed'''
| width="90%" class="mtx-class-macrohead" | '''ServoSetAutoMoveSpeed'''
|-
|-
| colspan="2" | Changes the speed of the auto movements  Default - 1&nbsp;
| colspan="2" | Changes the speed of the auto movements  Default - 1&nbsp;
Line 1,004: Line 959:


===ServoSetPosition===
===ServoSetPosition===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ServoSetPosition'''
| width="90%" class="mtx-class-macrohead" | '''ServoSetPosition'''
|-
|-
| colspan="2" | Allows one of the servo positions to be assigned&nbsp;
| colspan="2" | Allows one of the servo positions to be assigned&nbsp;
Line 1,028: Line 983:


===SetLogoSpeed===
===SetLogoSpeed===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetLogoSpeed'''
| width="90%" class="mtx-class-macrohead" | '''SetLogoSpeed'''
|-
|-
| colspan="2" | Sets the speed of logo movements&nbsp;
| colspan="2" | Sets the speed of logo movements&nbsp;
Line 1,047: Line 1,002:


===SetMotors===
===SetMotors===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetMotors'''
| width="90%" class="mtx-class-macrohead" | '''SetMotors'''
|-
|-
| colspan="2" | Sets the motor speeds without feedback Range -100 to 100&nbsp;
| colspan="2" | Sets the motor speeds without feedback Range -100 to 100&nbsp;
Line 1,071: Line 1,026:


===SetProp===
===SetProp===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetProp'''
| width="90%" class="mtx-class-macrohead" | '''SetProp'''
|-
|-
| colspan="2" | Allows the COM port property to be set from a parent component.&nbsp;
| colspan="2" | Allows the COM port property to be set from a parent component.&nbsp;
Line 1,096: Line 1,051:
==Property reference==
==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-
Line 1,122: Line 1,077:
| colspan="2" | &nbsp;
| colspan="2" | &nbsp;
|}
|}
==Component Source Code==
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_FormulaAllCode_API.fcsx FC_Comp_Source_FormulaAllCode_API.fcsx]
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_FormulaAllCode_API.fcsx FC_Comp_Source_FormulaAllCode_API.fcsx]

Latest revision as of 14:22, 13 July 2026

Author Matrix Ltd
Version 1.2
Category AllCode


Formula AllCode API component

A simulation only component to allow the Formula AllCode robot to be controlled via it's API interface and Bluetooth data connection without having to compile or re-program the robot.

Detailed description

No detailed description exists yet for this component

Examples

No additional examples

Macro reference

Backwards

Backwards
Drives the robot backwards - waits for the distance to be traversed before returning 
- UINT Distance
Distance in mm 
- VOID Return


CardBitmap

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


CardCreate

CardCreate
Attempts to create a file on the SD card 255=Error, 1=File Already Exists, 0=Create OK 
- STRING Filename
 
- BYTE Return


CardErase

CardErase
Attempts to delete an existing file on the SD card 255=Error, 1=File not found, 0=Delete OK 
- STRING Filename
 
- BYTE Return


CardInit

CardInit
Attempts to startup the SD card 255=No Card, 254=Init Fail, 0=Init OK 
- BYTE Return


CardOpen

CardOpen
Attempts to open an existing file on the SD card 255=Error, 1=File not found, 0=Open OK 
- STRING Filename
 
- BYTE Return


CardPlayback

CardPlayback
Plays back a .Wav file audio stream from the card 
- STRING Filename
 
- BYTE Return


CardReadByte

CardReadByte
Reads a byte from the currently open file. Starts at the beginning of the file and auto increments to the end 
- BYTE Return


CardRecordMic

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


CardWriteByte

CardWriteByte
Appends a byte to the end of the currently open file  
- BYTE Data
 
- VOID Return


EncoderRead

EncoderRead
Reads one of the motor encoder counters. Approx 0.328296mm of travel per encoder unit. 
- BYTE index
0=Left, 1=Right 
- UINT Return


EncoderReset

EncoderReset
Resets the motor encoder counters 
- VOID Return


Forwards

Forwards
Drives the robot forwards - waits for the distance to be traversed before returning 
- UINT Distance
Distance in mm 
- VOID Return


GetConsoleHandle

GetConsoleHandle
Gets the handle to the console allowing data displaying on the panel etc. 
- HANDLE Return


GetProp

GetProp
Allows the property filter for the COM port list to be copied to a parent component. 
- STRING PropName
 
- STRING Return


LCDBacklight

LCDBacklight
Allows the LCD backlight brighntess to be adjusted 
- BYTE Intensity
Range 0-100, 0=Off, 1=Min Brightness, 100=Max Brightness 
- VOID Return


LCDClear

LCDClear
Clears the LCD 
- VOID Return


LCDDrawLine

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


LCDDrawPixel

LCDDrawPixel
Allows a single pixel on the LCD to be set or cleared 
- BYTE X
X Pixel 0-127 
- BYTE Y
Y Pixel 0-31 
- BYTE State
0=White (Off), 1=Black (On) 
- VOID Return


LCDDrawRect

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


LCDPrintNumber

LCDPrintNumber
Prints a 16-bit signed number to the LCD 
- BYTE X
X Pixel 0-127 
- BYTE Y
LCD Y coordinate 0-31 
- INT Number
Range -32768 to 32767 
- VOID Return


LCDPrintString

LCDPrintString
Prints a string to the LCD 
- BYTE X
X Pixel 0-127 
- BYTE Y
LCD Y Coordinate 0-31 
- STRING Data
 
- VOID Return


LCDVerbose

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


LEDOff

LEDOff
Clears a single LED 0-7 
- BYTE index
Range: 0-7 
- VOID Return


LEDOn

LEDOn
Sets a single LED 0-7 
- BYTE index
Range: 0-7 
- VOID Return


LEDWrite

LEDWrite
Sets the value of the LEDs as an 8-bit output 
- BYTE Value
LED value 0=All Off, 255 = All On 
- VOID Return


Left

Left
Rotates the robot left - waits for the angle to be traversed before returning 
- UINT Angle
Angle to turn in degrees 
- VOID Return


PlayNote

PlayNote
Plays a note using the speaker on the FA 
- UINT Note
Range 1 to 65535 in Hz 
- UINT Delay
Number of milliseconds to play the note for 
- VOID Return


ReadAllSensors

ReadAllSensors
Samples all of the robot's sensors at once, storing the values locally 
- VOID Return


ReadAllValue

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


ReadAxis

ReadAxis
Reads a single X/Y/Z axis from the accelerometer sensor.  
- BYTE index
0=X, 1=Y, 2=Z 
- INT Return


ReadBearing

ReadBearing
Reads the compass bearing based on the degrees clockwise from magnetic north. 
- INT Return


ReadIR

ReadIR
Reads an IR sensor 0=Left, 1=FrontLeft, 2=Front, 3=FrontRight, 4=Right, 5=RearRight, 6=Rear, 7=RearLeft 
- BYTE index
0=Left, 1=FrontLeft, 2=Front, 3=FrontRight, 4=Right, 5=RearRight, 6=Rear, 7=RearLeft 
- UINT Return


ReadLight

ReadLight
Reads the light sensor 0-4095 - 4095 = Max Brightness 
- UINT Return


ReadLine

ReadLine
Reads one of the IR line sensors 0-1 0=Left, 1=Right 
- BYTE index
0=Left, 1=Right 
- UINT Return


ReadMic

ReadMic
Reads the microphone sensor 0 - 4095 
- UINT Return


ReadSwitch

ReadSwitch
Read the switch value 
- BYTE index
0 (left) or 1 (right) 
- BYTE Return


Right
Rotates the robot right - waits for the angle to be traversed before returning 
- UINT Angle
Angle to turn in degrees 
- VOID Return


SampleAccel

SampleAccel
Samples the accelerometer 0 = no new data, 1 = new data available 
- BYTE Return


SampleMag

SampleMag
Samples the magnetometer 0 = no new data, 1 = new data available 
- BYTE Return


ServoAutoMoveToPosition

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


ServoDisable

ServoDisable
Allows one of the servo outputs 0-3 to be disabled 
- BYTE Channel
Range 0-3 
- VOID Return


ServoEnable

ServoEnable
Allows one of the servo outputs 0-3 to be enabled 
- BYTE Channel
Range 0-3 
- VOID Return


ServoSetAutoMoveSpeed

ServoSetAutoMoveSpeed
Changes the speed of the auto movements Default - 1 
- BYTE Speed
Range 1-50 
- VOID Return


ServoSetPosition

ServoSetPosition
Allows one of the servo positions to be assigned 
- BYTE Channel
Range 0-3 
- BYTE Position
Range 0-255 
- VOID Return


SetLogoSpeed

SetLogoSpeed
Sets the speed of logo movements 
- BYTE Speed
Logo Speed 1-100 - Default 40 
- VOID Return


SetMotors

SetMotors
Sets the motor speeds without feedback Range -100 to 100 
- INT Left
Range -100 to 100 
- INT Right
Range -100 to 100 
- VOID Return


SetProp

SetProp
Allows the COM port property to be set from a parent component. 
- STRING PropName
 
- ULONG PropVal
 
- VOID Return


Property reference

Properties
COM Port
Selects which port to communicate with, only lists ports which are currently available.  
Refresh COM Ports
When set to yes the COM port list is rescanned for newly connected or available ports. Note that refreshing the ports list may take a few seconds depending on the number of connected ports. 
Baud
Baud rate passed to the COM port to control the rate of data. 
Label
 

Component Source Code

Please click here to download the component source project: FC_Comp_Source_FormulaAllCode_API.fcsx

Please click here to view the component source code (Beta): FC_Comp_Source_FormulaAllCode_API.fcsx