|  |   | 
| (8 intermediate revisions by 2 users not shown) | 
| Line 15: | Line 15: | 
|  | A component to allow all the features of the Formula AllCode robot to be investigated. Fully simulated component which can interact with simulated objects on the panel as well as control the real hardware.   |  | A component to allow all the features of the Formula AllCode robot to be investigated. Fully simulated component which can interact with simulated objects on the panel as well as control the real hardware.   | 
|  |  |  |  | 
| − | ==Component Source Code== | + | ==Detailed description== | 
|  | + |   | 
|  |  |  |  | 
| − | Please click here to download the component source project: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_FA_Source_P4.fcfx FC_Comp_Source_FA_Source_P4.fcfx]
 |  | 
|  |  |  |  | 
| − | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_FA_Source_P4.fcfx FC_Comp_Source_FA_Source_P4.fcfx]
 |  | 
|  |  |  |  | 
| − | ==Detailed description==
 |  | 
|  |  |  |  | 
|  |  |  |  | 
| Line 33: | Line 31: | 
|  | ==Examples== |  | ==Examples== | 
|  |  |  |  | 
|  | + | ===Line Following=== | 
|  | + |  | 
|  | + | Line following example using the Formula AllCode, works with objects on the simulation panel and on the real hardware. | 
|  | + |  | 
|  | + | {{Fcfile|FA-Line.fcfx|FA-Line}} | 
|  |  |  |  | 
|  | + | [[File:FALine.jpg]] | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===Simulation with the API component=== | 
|  |  |  |  | 
|  | + | An example showing how to use the API component to drive the robot in simulation. | 
|  | + |  | 
|  | + | {{Fcfile|FA_API_Sim_Demo.fcfx|FA API Sim Demo}} | 
|  |  |  |  | 
|  |  |  |  | 
| − | ''<span style="color:red;">No additional examples</span>''
 |  | 
|  |  |  |  | 
|  | ==Macro reference== |  | ==Macro reference== | 
|  |  |  |  | 
|  | + | ===AudioAddToBuffer=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PlayNote''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AudioAddToBuffer''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Outputs asingle tone from theonboard speaker for the period specified.  | + | | colspan="2" | Writes a value to the 16-bit audio output buffer.  | 
|  | |- |  | |- | 
|  | |- |  | |- | 
|  | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT |  | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | 
| − | | width="90%" | Note | + | | width="90%" | Data | 
|  | |- |  | |- | 
| − | | colspan="2" | Sets the pitch of the note in Hz. Range: 1 - 10000  | + | | colspan="2" |   | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" | Time
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Time period to play the note for in milliseconds. Range: 0 - 65535 ms 
 |  | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
| Line 66: | Line 69: | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===AudioQueueLength=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LEDOn''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AudioQueueLength''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Switches on a single LED on thefront of theFormula Allcode.   | + | | colspan="2" | Retreives the current length of valid data within the audio queue  | 
|  | |- |  | |- | 
|  | |- |  | |- | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] -BYTE | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT | 
| − | | width="90%" | LED | + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
|  | + | |} | 
|  | + |   | 
|  | + |   | 
|  | + | ===AudioReadFromBuffer=== | 
|  | + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | + | |- | 
|  | + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
|  | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AudioReadFromBuffer''' | 
|  | + | |- | 
|  | + | | colspan="2" | Allows the audio buffer to be used for other streaming data such as recording the mic.   | 
|  | |- |  | |- | 
| − | | colspan="2" | Which LED to switch on, range 0-7 
 |  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] -VOID | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT | 
|  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
|  | |} |  | |} | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===AudioStreamControl=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''BluetoothTransmit''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AudioStreamControl''' | 
|  | + | |- | 
|  | + | | colspan="2" | Allows control of the audio output functionality via the onboard speaker. Data is loaded into the audio output buffer using the AddToBuffer function.  | 
|  | + | |- | 
|  | |- |  | |- | 
| − | | colspan="2" |Sends a byte via the Bluetooth data connection.  | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
|  | + | | width="90%" | Mode | 
|  | |- |  | |- | 
|  | + | | colspan="2" | 0=Off, 8=8-bit Mode, 16=16-bit Mode  | 
|  | |- |  | |- | 
|  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" | Data | + | | width="90%" | SampleRate | 
|  | |- |  | |- | 
| − | | colspan="2" |   | + | | colspan="2" | Sets the sample rate 0=8KHz, 1=16KHz  | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
| Line 102: | Line 121: | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===BluetoothCheckConnection=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDPrintString''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''BluetoothCheckConnection''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Prints a string to thegraphical LCD.  | + | | colspan="2" | Checks the status of the Bluetooth connection. Returns 0 for not paired and 1 for paired.  | 
|  | |- |  | |- | 
|  | |- |  | |- | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" | X | + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
|  | + | |} | 
|  | + |   | 
|  | + |   | 
|  | + | ===BluetoothQueueLength=== | 
|  | + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
| − | | colspan="2" |The horizontal start pixel.Range 0-127  | + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
|  | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''BluetoothQueueLength''' | 
|  | |- |  | |- | 
| − | | width="10%" align="center" |[[File:Fc9-u8-icon.png]] - BYTE | + | | colspan="2" | Reads the length of received Bluetooth data in bytes.   | 
| − | | width="90%" | Y
 |  | 
|  | |- |  | |- | 
| − | | colspan="2" | Y coordinate to print the string. Range 0-31 
 |  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" | [[File:Fc9-string-icon.png]] -STRING | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT | 
| − | | width="90%" | Data | + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
|  | + | |} | 
|  | + |   | 
|  | + |   | 
|  | + | ===BluetoothReceive=== | 
|  | + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
| − | | colspan="2" |  | + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
|  | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''BluetoothReceive''' | 
|  | |- |  | |- | 
| − | | width="10%" align="center" |[[File:Fc9-u16-icon.png]] - UINT | + | | colspan="2" | Attempt to read a byte from the Bluetooth receive queue.  | 
| − | | width="90%" | Transparent
 |  | 
|  | |- |  | |- | 
| − | | colspan="2" |  
 |  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] -VOID | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | 
|  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
|  | |} |  | |} | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===BluetoothTransmit=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LogoConfigure''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''BluetoothTransmit''' | 
|  | |- |  | |- | 
| − | | colspan="2" | The Logo movement may sometimes be slightly off in terms of distance or angle. Before tweaking thefactory values check that the wheels are pushed well onto their shafts but not tight against the FA body. Also check the tyre is on the wheel correctly.   | + | | colspan="2" | Sends a byte via the Bluetooth data connection.  | 
|  | |- |  | |- | 
|  | |- |  | |- | 
| − | | width="10%" align="center" | [[File:Fc9-f32-icon.png]] -FLOAT | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" | Distance | + | | width="90%" | Data | 
|  | |- |  | |- | 
| − | | colspan="2" | mm per encoder step. default = 0.32  | + | | colspan="2" |   | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 |  | 
| − | | width="90%" | Angle
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | mm of travel per degree. default = 0.7295 
 |  | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
| Line 158: | Line 182: | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===BluetoothTransmitString=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Stop''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''BluetoothTransmitString''' | 
|  | + | |- | 
|  | + | | colspan="2" | Sends a string via the Bluetooth data connection.  | 
|  | |- |  | |- | 
| − | | colspan="2" | Stops both motors. 
 |  | 
|  | |- |  | |- | 
|  | + | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | 
|  | + | | width="90%" | Data | 
|  | + | |- | 
|  | + | | colspan="2" |   | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
| Line 171: | Line 201: | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===CheckIR=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadBattery''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckIR''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Reads thecurrent voltage level from theLiPo battery. Return value is thebattery voltage in Volts.Take care not to run thebattery too low.  Voltages lower than3.4V may damage thebattery.  | + | | colspan="2" | Checks to see if a IR sensor is within the master threshold distance. Returns 0 if the IR reading is below the threshold. Returns 1 if the IR reading is greater than or equal to the threshold.  | 
|  | |- |  | |- | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] -FLOAT | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
|  | + | | width="90%" | Sensor | 
|  | + | |- | 
|  | + | | colspan="2" | Range: 0 to 7 - 0=Left, 1=Front Left, 2=Front, 3=Front Right, 4=Right, 5=Rear Right, 6=Rear, 7=Rear Left  | 
|  | + | |- | 
|  | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | 
|  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
|  | |} |  | |} | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===CheckLine=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LEDOff''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckLine''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Switches off asingle LED on thefront of theFormula Allcode.   | + | | colspan="2" | Checks to see if a line sensor is within the master threshold distance. Returns 0 if the IR reading is below the threshold. Returns 1 if the IR reading is greater than or equal to the threshold.  | 
|  | |- |  | |- | 
|  | |- |  | |- | 
|  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" | LED | + | | width="90%" | Sensor | 
|  | |- |  | |- | 
| − | | colspan="2" | Which LED toswitch on,range 0-7  | + | | colspan="2" | Range: 0 to 1 - 0=Left, 1=Right  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] -VOID | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | 
|  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
|  | |} |  | |} | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===CheckUSB=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDPrintNumber''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckUSB''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Prints anumeric value to thegraphical LCD.  | + | | colspan="2" | Checks to see if a USB cable is connected to the robot. Returns 0 for no connection and 1 for an active connection.  | 
|  | |- |  | |- | 
|  | |- |  | |- | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" | X | + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
|  | + | |} | 
|  | + |   | 
|  | + |   | 
|  | + | ===EncoderReadCount=== | 
|  | + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | + | |- | 
|  | + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
|  | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EncoderReadCount''' | 
|  | + | |- | 
|  | + | | colspan="2" | Reads one of the motor encoder counters. Each encoder count is equal to 0.314159 mm.   | 
|  | |- |  | |- | 
| − | | colspan="2" | The horizontal start pixel. Range 0-127 
 |  | 
|  | |- |  | |- | 
|  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" | Y | + | | width="90%" | Channel | 
|  | |- |  | |- | 
| − | | colspan="2" | Y coordinate to print the string. Range 0-31  | + | | colspan="2" | 0 = LeftCount, 1=RightCount  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT | 
| − | | width="90%" | Number | + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
|  | + | |} | 
|  | + |   | 
|  | + |   | 
|  | + | ===EncoderReset=== | 
|  | + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
| − | | colspan="2" |  | + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
|  | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EncoderReset''' | 
|  | |- |  | |- | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | + | | colspan="2" | Resets the encoder counters to 0  | 
| − | | width="90%" |Transparent
 |  | 
|  | |- |  | |- | 
| − | | colspan="2" |  
 |  | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
| Line 235: | Line 286: | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===Forward=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LEDWrite''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Forward''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Allows control ofall 8-LEDs on thefront of theFormula Allcode.   | + | | colspan="2" | Drives both motors of the formula flowcode forwards with the power specified.   | 
|  | |- |  | |- | 
|  | |- |  | |- | 
|  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" | LED_Byte | + | | width="90%" | Power | 
|  | |- |  | |- | 
| − | | colspan="2" | 8-bit binary value towrite tothe 8 LEDs  | + | | colspan="2" | Amount of power to use to drive motor. Range 0-100  | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
| Line 253: | Line 305: | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===Initialise=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''BluetoothCheckConnection''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Checks thestatus of the Bluetooth connection. Returns 0 fornot paired and1 forpaired.  | + | | colspan="2" | Starts up the Formula Allcode PWM for motor control and performs the wait for button press if enabled.  | 
|  | |- |  | |- | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] -BYTE | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
|  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
|  | |} |  | |} | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===LCDBacklight=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadMic''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDBacklight''' | 
|  | + | |- | 
|  | + | | colspan="2" | Controls the brighness of the LCD backlight  | 
|  | + | |- | 
|  | |- |  | |- | 
| − | | colspan="2" |Reads the current audio signal level from the on-board microphone. Return value range: 0 to 4095  | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
|  | + | | width="90%" | Brightness | 
|  | |- |  | |- | 
|  | + | | colspan="2" | Range: 0-100, 0=Off, 1=Min Brightness, 100=Max Brightness  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] -UINT | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
|  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
|  | |} |  | |} | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===LCDClear=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AudioQueueLength''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDClear''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Retreives thecurrent length ofvalid data within theaudio queue  | + | | colspan="2" | Clears the contents of the graphical LCD.  | 
|  | |- |  | |- | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] -UINT | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
|  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
|  | |} |  | |} | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===LCDDrawLine=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AudioAddToBuffer''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDDrawLine''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Writes avalue to the16-bit audio output buffer.  | + | | colspan="2" | Draws a line on the LCD.  | 
|  | |- |  | |- | 
|  | |- |  | |- | 
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] -UINT | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" | Data | + | | width="90%" | X1 | 
|  | |- |  | |- | 
| − | | colspan="2" |   | + | | colspan="2" | Range 0-127  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] -VOID | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" style="border-top: 2px solid #000;" |''Return'' | + | | width="90%" | Y1 | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" |[[File:Fc9-comp-macro.png]] | + | | colspan="2" | Range 0-31  | 
| − | | width="90%" style="background-color:#D8C9D8;color:#4B008D;" | '''ReadSwitch'''
 |  | 
|  | |- |  | |- | 
| − | | colspan="2" |Reads the value of one of the switches from the front of the Formula Allcode.  | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
|  | + | | width="90%" | X2 | 
|  | |- |  | |- | 
|  | + | | colspan="2" | Range 0-127  | 
|  | |- |  | |- | 
|  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" | Switch | + | | width="90%" | Y2 | 
|  | |- |  | |- | 
| − | | colspan="2" | Which switch do we want to read 0=Left, 1=Right  | + | | colspan="2" | Range 0-31  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] -BYTE | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
|  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
|  | |} |  | |} | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===LCDDrawRectangle=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckLine''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDDrawRectangle''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Checks to see if aline sensor is within themaster threshold distance. Returns 0 if the IR reading is below the threshold. Returns 1 if the IR reading is greater than or equal to the threshold.  | + | | colspan="2" | Draws a rectange on the LCD.  | 
|  | |- |  | |- | 
|  | |- |  | |- | 
|  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" | Sensor | + | | width="90%" | X1 | 
|  | |- |  | |- | 
| − | | colspan="2" | Range: 0 to 1 -0=Left, 1=Right  | + | | colspan="2" | Range 0-127  | 
|  | + | |- | 
|  | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
|  | + | | width="90%" | Y1 | 
|  | + | |- | 
|  | + | | colspan="2" | Range 0-31  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" style="border-top: 2px solid #000;" |''Return'' | + | | width="90%" | X2 | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" |[[File:Fc9-comp-macro.png]] | + | | colspan="2" | Range 0-127  | 
| − | | width="90%" style="background-color:#D8C9D8;color:#4B008D;" | '''AudioStreamControl'''
 |  | 
|  | |- |  | |- | 
| − | | colspan="2" |Allows control of the audio output functionality via the onboard speaker.Data is loaded into the audio output buffer using the AddToBuffer function.  | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
|  | + | | width="90%" | Y2 | 
|  | |- |  | |- | 
|  | + | | colspan="2" | Range 0-31  | 
|  | |- |  | |- | 
|  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" | Mode | + | | width="90%" | Transparent | 
|  | |- |  | |- | 
| − | | colspan="2" | 0=Off, 8=8-bit Mode,16=16-bit Mode  | + | | colspan="2" | Sets the transparency of the box, 0=Box contains background colour, 1=Box contains previous pixel data  | 
|  | |- |  | |- | 
|  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" | SampleRate | + | | width="90%" | Solid | 
|  | |- |  | |- | 
| − | | colspan="2" | Sets thesample rate 0=8KHz, 1=16KHz  | + | | colspan="2" | Chooses to fill the box with colour, 0=Box contains transparency data, 1=Box contains foreground colour  | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
| Line 369: | Line 430: | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===LCDPlotPixel=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SpinLeft''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDPlotPixel''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Spins the formula flowcode on thespot in an anticlockwise direction as seen from above.   | + | | colspan="2" | Allows a single pixel on the LCD to be set or cleared.  | 
|  | |- |  | |- | 
|  | |- |  | |- | 
|  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" | Power | + | | width="90%" | X | 
|  | + | |- | 
|  | + | | colspan="2" | Sets the X coordinate - Range 0-127  | 
|  | + | |- | 
|  | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
|  | + | | width="90%" | Y | 
|  | |- |  | |- | 
| − | | colspan="2" | Amount of power to use to drive motor. Range 0-100  | + | | colspan="2" | Sets the Y coordinate - Range 0-31  | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
| Line 387: | Line 454: | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===LCDPrintNumber=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LogoTurnLeft''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDPrintNumber''' | 
|  | + | |- | 
|  | + | | colspan="2" | Prints a numeric value to the graphical LCD.  | 
|  | |- |  | |- | 
| − | | colspan="2" | Rotates the robot left by a specific angle using the encoders as feedback to ensure the robot turns evenly. Automatically stops at the specified turn angle. 
 |  | 
|  | |- |  | |- | 
|  | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
|  | + | | width="90%" | X | 
|  | |- |  | |- | 
| − | | width="10%" align="center" |[[File:Fc9-u16-icon.png]] -UINT | + | | colspan="2" | The horizontal start pixel. Range 0-127  | 
| − | | width="90%" | Angle
 |  | 
|  | |- |  | |- | 
| − | | colspan="2" |Angle in degrees you wish to rotate.Range 1-65536  | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
|  | + | | width="90%" | Y | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" |[[File:Fc9-void-icon.png]] - VOID | + | | colspan="2" | Y coordinate to print the string. Range 0-31  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | + | | width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Forward''' | + | | width="90%" | Number | 
| − | |-
 |  | 
| − | | colspan="2" |Drives both motors of the formula flowcode forwards with the power specified.  
 |  | 
|  | |- |  | |- | 
|  | + | | colspan="2" |   | 
|  | |- |  | |- | 
|  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" | Power | + | | width="90%" | Transparent | 
|  | |- |  | |- | 
| − | | colspan="2" | Amount of power to use to drive motor. Range 0-100  | + | | colspan="2" |   | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
| Line 423: | Line 488: | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===LCDPrintString=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDWriteByte''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDPrintString''' | 
|  | |- |  | |- | 
| − | | colspan="2" |   | + | | colspan="2" | Prints a string to the graphical LCD.  | 
|  | |- |  | |- | 
|  | |- |  | |- | 
|  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" | Data | + | | width="90%" | X | 
|  | |- |  | |- | 
| − | | colspan="2" |   | + | | colspan="2" | The horizontal start pixel. Range 0-127  | 
|  | |- |  | |- | 
|  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" | X | + | | width="90%" | Y | 
|  | |- |  | |- | 
| − | | colspan="2" |   | + | | colspan="2" | Y coordinate to print the string. Range 0-31  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] -BYTE | + | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | 
| − | | width="90%" | Y | + | | width="90%" | Data | 
|  | + | |- | 
|  | + | | colspan="2" |   | 
|  | + | |- | 
|  | + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | 
|  | + | | width="90%" | Transparent | 
|  | |- |  | |- | 
|  | | colspan="2" |   |  | | colspan="2" |   | 
| Line 451: | Line 522: | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===LCDSetBackgroundColour=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''BluetoothReceive''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDSetBackgroundColour''' | 
|  | + | |- | 
|  | + | | colspan="2" | Sets the pixel colour to drive the LCD. Default colour is 1 where a set pixel is black and the background is white.  | 
|  | + | |- | 
|  | |- |  | |- | 
| − | | colspan="2" |Attempt to read a byte from the Bluetooth receive queue.  | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
|  | + | | width="90%" | Colour | 
|  | |- |  | |- | 
|  | + | | colspan="2" | Range 0-1 : 0=White, 1=Black  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] -BYTE | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
|  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
|  | |} |  | |} | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===LCDSetForegroundColour=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDDrawLine''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDSetForegroundColour''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Draws aline on theLCD.  | + | | colspan="2" | Sets the pixel colour to drive the LCD. Default colour is 1 where a set pixel is black and the background is white.  | 
|  | |- |  | |- | 
|  | |- |  | |- | 
|  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" | X1 | + | | width="90%" | Colour | 
|  | |- |  | |- | 
| − | | colspan="2" | Range 0-127  | + | | colspan="2" | Range 0-1 : 0=White, 1=Black  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
| − | | width="90%" | Y1 | + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
| − | |- | + | |} | 
| − | | colspan="2" | Range 0-31  | + |   | 
|  | + |   | 
|  | + | ===LCDWriteByte=== | 
|  | + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | + | |- | 
|  | + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
|  | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDWriteByte''' | 
|  | + | |- | 
|  | + | | colspan="2" |   | 
|  | + | |- | 
|  | + | |- | 
|  | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
|  | + | | width="90%" | Data | 
|  | + | |- | 
|  | + | | colspan="2" |   | 
|  | |- |  | |- | 
|  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" | X2 | + | | width="90%" | X | 
|  | |- |  | |- | 
| − | | colspan="2" | Range 0-127  | + | | colspan="2" |   | 
|  | |- |  | |- | 
|  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" | Y2 | + | | width="90%" | Y | 
|  | |- |  | |- | 
| − | | colspan="2" | Range 0-31  | + | | colspan="2" |   | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
| Line 497: | Line 589: | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===LEDOff=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''BluetoothQueueLength''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LEDOff''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Reads thelength ofreceived Bluetooth data in bytes.   | + | | colspan="2" | Switches off a single LED on the front of the Formula Allcode.   | 
|  | |- |  | |- | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] -UINT | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
|  | + | | width="90%" | LED | 
|  | + | |- | 
|  | + | | colspan="2" | Which LED to switch on, range 0-7  | 
|  | + | |- | 
|  | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
|  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
|  | |} |  | |} | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===LEDOn=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''BluetoothTransmitString''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LEDOn''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Sends astring via theBluetooth data connection.  | + | | colspan="2" | Switches on a single LED on the front of the Formula Allcode.   | 
|  | |- |  | |- | 
|  | |- |  | |- | 
| − | | width="10%" align="center" | [[File:Fc9-string-icon.png]] -STRING | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" | Data | + | | width="90%" | LED | 
|  | |- |  | |- | 
| − | | colspan="2" |   | + | | colspan="2" | Which LED to switch on, range 0-7  | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
| Line 528: | Line 627: | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===LEDWrite=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDBacklight''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LEDWrite''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Controls thebrighness of theLCD backlight  | + | | colspan="2" | Allows control of all 8-LEDs on the front of the Formula Allcode.   | 
|  | |- |  | |- | 
|  | |- |  | |- | 
|  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" | Brightness | + | | width="90%" | LED_Byte | 
|  | |- |  | |- | 
| − | | colspan="2" | Range: 0-100, 0=Off, 1=Min Brightness, 100=Max Brightness  | + | | colspan="2" | 8-bit binary value to write to the 8 LEDs  | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
| Line 546: | Line 646: | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===LogoBackwards=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AudioReadFromBuffer''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LogoBackwards''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Allows theaudio buffer tobe used for other streaming data such as recording themic.   | + | | colspan="2" | Drives the robot backward using the encoders as feedback to ensure the robot drives straight. Automatically stops at the specified distance.  | 
|  | |- |  | |- | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] -UINT | + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | + | | width="90%" | Distance | 
|  | + | |- | 
|  | + | | colspan="2" | Distance you want to robot to drive in mm. Range 1-65535  | 
|  | + | |- | 
|  | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
|  | + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
|  | |} |  | |} | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===LogoConfigure=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadLineSensor''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LogoConfigure''' | 
|  | + | |- | 
|  | + | | colspan="2" | The Logo movement may sometimes be slightly off in terms of distance or angle. Before tweaking the factory values check that the wheels are pushed well onto their shafts but not tight against the FA body. Also check the tyre is on the wheel correctly.   | 
|  | + | |- | 
|  | |- |  | |- | 
| − | | colspan="2" |Reads the analogue value from the specified IR line sensor. Return value range:0 to 4095 4095 represents the object is reflecting the most light.  | + | | width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT | 
|  | + | | width="90%" | Distance | 
|  | |- |  | |- | 
|  | + | | colspan="2" | mm per encoder step. default = 0.32  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] -BYTE | + | | width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT | 
| − | | width="90%" | Channel | + | | width="90%" | Angle | 
|  | |- |  | |- | 
| − | | colspan="2" | Range: 0 to 1 - 0=Left, 1=Right  | + | | colspan="2" | mm of travel per degree. default = 0.7295  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] -UINT | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
|  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
|  | |} |  | |} | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===LogoForwards=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LogoTurnRight''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LogoForwards''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Rotates the robotright by a specific angle using the encoders as feedback to ensure the robotturns evenly. Automatically stops at the specifiedturn angle.  | + | | colspan="2" | Drives the robot forward using the encoders as feedback to ensure the robot drives straight. Automatically stops at the specified distance.  | 
|  | |- |  | |- | 
|  | |- |  | |- | 
|  | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT |  | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | 
| − | | width="90%" | Angle | + | | width="90%" | Distance | 
|  | |- |  | |- | 
| − | | colspan="2" | Angle in degrees youwish torotate. Range 1-65536  | + | | colspan="2" | Distance you want to robot to drive in mm. Range 1-65535  | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
| Line 595: | Line 708: | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===LogoSetSpeed=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SpinRight''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LogoSetSpeed''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Spins theformula flowcode on the spot in a clockwise direction as seen from above.   | + | | colspan="2" | Sets the cruise speed for LOGO type macros. Default speed 20%.  | 
|  | |- |  | |- | 
|  | |- |  | |- | 
|  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" | Power | + | | width="90%" | Speed | 
|  | |- |  | |- | 
| − | | colspan="2" | Amount of power to use to drive motor. Range0-100  | + | | colspan="2" | Range 1-100, Default 60  | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
| Line 613: | Line 727: | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===LogoTurnLeft=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckIR''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LogoTurnLeft''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Checks to see if aIR sensor is within themaster threshold distance. Returns 0 if theIR reading is below the threshold.Returns 1 if the IR reading is greater than or equal to thethreshold.  | + | | colspan="2" | Rotates the robot left by a specific angle using the encoders as feedback to ensure the robot turns evenly. Automatically stops at the specified turn angle.  | 
|  | |- |  | |- | 
|  | |- |  | |- | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] -BYTE | + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | 
| − | | width="90%" | Sensor | + | | width="90%" | Angle | 
|  | |- |  | |- | 
| − | | colspan="2" | Range: 0 to 7 -0=Left, 1=Front Left, 2=Front, 3=Front Right, 4=Right, 5=Rear Right, 6=Rear, 7=Rear Left  | + | | colspan="2" | Angle in degrees you wish to rotate. Range 1-65536  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] -BYTE | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
|  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
|  | |} |  | |} | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===LogoTurnRight=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDPlotPixel''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LogoTurnRight''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Allows asingle pixel on theLCD tobe set or cleared.  | + | | colspan="2" | Rotates the robot right by a specific angle using the encoders as feedback to ensure the robot turns evenly. Automatically stops at the specified turn angle.  | 
|  | |- |  | |- | 
|  | |- |  | |- | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] -BYTE | + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | 
| − | | width="90%" | X | + | | width="90%" | Angle | 
|  | |- |  | |- | 
| − | | colspan="2" | Sets the X coordinate - Range 0-127  | + | | colspan="2" | Angle in degrees you wish to rotate. Range 1-65536  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Y
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Sets the Y coordinate - Range0-31 
 |  | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
| Line 654: | Line 765: | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===PlayNote=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDSetBackgroundColour''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PlayNote''' | 
|  | + | |- | 
|  | + | | colspan="2" | Outputs a single tone from the onboard speaker for the period specified.  | 
|  | + | |- | 
|  | |- |  | |- | 
| − | | colspan="2" |Sets the pixel colour to drive the LCD.Default colour is 1 where a set pixel is black and the background is white.  | + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | 
|  | + | | width="90%" | Note | 
|  | |- |  | |- | 
|  | + | | colspan="2" | Sets the pitch of the note in Hz. Range: 1 - 10000  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] -BYTE | + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | 
| − | | width="90%" | Colour | + | | width="90%" | Time | 
|  | |- |  | |- | 
| − | | colspan="2" | Range 0-1 : 0=White, 1=Black  | + | | colspan="2" | Time period to play the note for in milliseconds. Range: 0 - 65535 ms  | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
| Line 672: | Line 789: | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===ReadBattery=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadIRSensor''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadBattery''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Reads the analogue value from thespecified IR distance sensor. Return valuerange: 0 to4095 4095 represents theobject is very close.  | + | | colspan="2" | Reads the current voltage level from the LiPo battery. Return value is the battery voltage in Volts. Take care not to run the battery too low.  Voltages lower than 3.4V may damage the battery.  | 
|  | |- |  | |- | 
|  | |- |  | |- | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT | 
| − | | width="90%" | Channel
 | + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
| − | |-
 | + | |} | 
| − | | colspan="2" | Range: 0 to 7 - 0=Left, 1=Front Left, 2=Front, 3=Front Right, 4=Right, 5=Rear Right, 6=Rear, 7=Rear Left 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] -UINT |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |  | 
| − | |} |  | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===ReadIRSensor=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetMotors''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadIRSensor''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Sets thespeed and direction of theFormula Allcode motors.   | + | | colspan="2" | Reads the analogue value from the specified IR distance sensor. Return value range: 0 to 4095 4095 represents the object is very close.  | 
|  | |- |  | |- | 
|  | |- |  | |- | 
| − | | width="10%" align="center" | [[File:Fc9-s16-icon.png]] -INT | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" | Left | + | | width="90%" | Channel | 
|  | |- |  | |- | 
| − | | colspan="2" | Valid Range =-100 to 100  | + | | colspan="2" | Range: 0 to 7 - 0=Left, 1=Front Left, 2=Front, 3=Front Right, 4=Right, 5=Rear Right, 6=Rear, 7=Rear Left  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT
 | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT | 
| − | | width="90%" | Right
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Valid Range = -100 to 100 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] -VOID |  | 
|  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
|  | |} |  | |} | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===ReadLDR=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LogoBackwards''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadLDR''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Drives therobot backward using theencoders as feedback toensure therobot drives straight. Automatically stops at thespecified distance.  | + | | colspan="2" | Reads the current light level from the on board light sensor. Return value range: 0 to 4095 4095 represents the maximum level of light and 0 represents the minimal level of light.  | 
|  | |- |  | |- | 
|  | |- |  | |- | 
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT | 
| − | | width="90%" | Distance
 | + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
| − | |-
 | + | |} | 
| − | | colspan="2" | Distance you want to robot to drive in mm. Range 1-65535 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] -VOID |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |  | 
| − | |} |  | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===ReadLineSensor=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EncoderReset''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadLineSensor''' | 
|  | + | |- | 
|  | + | | colspan="2" | Reads the analogue value from the specified IR line sensor. Return value range: 0 to 4095 4095 represents the object is reflecting the most light.  | 
|  | + | |- | 
|  | |- |  | |- | 
| − | | colspan="2" |Resets the encoder counters to 0  | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
|  | + | | width="90%" | Channel | 
|  | |- |  | |- | 
|  | + | | colspan="2" | Range: 0 to 1 - 0=Left, 1=Right  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] -VOID | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT | 
|  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
|  | |} |  | |} | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===ReadMic=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Reverse''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadMic''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Drives both motors of theformula flowcode backwards with thepower specified.   | + | | colspan="2" | Reads the current audio signal level from the on-board microphone.  Return value range: 0 to 4095  | 
|  | |- |  | |- | 
|  | |- |  | |- | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT | 
| − | | width="90%" | Power
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Amount of power to use to drive motor. Range 0-100 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] -VOID |  | 
|  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
|  | |} |  | |} | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===ReadSwitch=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WaitForSwitch''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadSwitch''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Waits for thespecified switch to be pressed.  | + | | colspan="2" | Reads the value of one of the switches from the front of the Formula Allcode.  | 
|  | |- |  | |- | 
|  | |- |  | |- | 
| Line 773: | Line 881: | 
|  | | width="90%" | Switch |  | | width="90%" | Switch | 
|  | |- |  | |- | 
| − | | colspan="2" | Which switch do we want to wait for 0=Left, 1=Right, 2=Either, 3=Both  | + | | colspan="2" | Which switch do we want to read 0=Left, 1=Right  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] -VOID | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | 
|  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
|  | |} |  | |} | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===Reverse=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadLDR''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Reverse''' | 
|  | + | |- | 
|  | + | | colspan="2" | Drives both motors of the formula flowcode backwards with the power specified.   | 
|  | + | |- | 
|  | |- |  | |- | 
| − | | colspan="2" |Reads the current light level from the on board light sensor. Return value range:0 to 4095 4095 represents the maximum level of light and 0 represents the minimal level of light.  | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
|  | + | | width="90%" | Power | 
|  | |- |  | |- | 
|  | + | | colspan="2" | Amount of power to use to drive motor. Range 0-100  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] -UINT | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
|  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
|  | |} |  | |} | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===SetMotors=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDDrawRectangle''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetMotors''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Draws a rectange on theLCD.  | + | | colspan="2" | Sets the speed and direction of the Formula Allcode motors.   | 
|  | |- |  | |- | 
|  | |- |  | |- | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] -BYTE | + | | width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT | 
| − | | width="90%" | X1 | + | | width="90%" | Left | 
|  | |- |  | |- | 
| − | | colspan="2" | Range 0-127  | + | | colspan="2" | Valid Range = -100 to 100  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] -BYTE | + | | width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT | 
| − | | width="90%" | Y1 | + | | width="90%" | Right | 
|  | |- |  | |- | 
| − | | colspan="2" | Range 0-31  | + | | colspan="2" | Valid Range = -100 to 100  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] -BYTE | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
| − | | width="90%" | X2 | + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
|  | + | |} | 
|  | + |   | 
|  | + |   | 
|  | + | ===SpinLeft=== | 
|  | + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
| − | | colspan="2" |Range 0-127  | + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
|  | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SpinLeft''' | 
|  | |- |  | |- | 
| − | | width="10%" align="center" |[[File:Fc9-u8-icon.png]] - BYTE | + | | colspan="2" | Spins the formula flowcode on the spot in an anticlockwise direction as seen from above.   | 
| − | | width="90%" | Y2
 |  | 
|  | |- |  | |- | 
| − | | colspan="2" | Range 0-31 
 |  | 
|  | |- |  | |- | 
|  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" | Transparent | + | | width="90%" | Power | 
|  | |- |  | |- | 
| − | | colspan="2" | Sets the transparency ofthe box, 0=Box contains background colour, 1=Box contains previous pixel data  | + | | colspan="2" | Amount of power to use to drive motor. Range 0-100  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] -BYTE
 |  | 
| − | | width="90%" | Solid
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Chooses to fill the box with colour, 0=Box contains transparency data, 1=Box contains foreground colour 
 |  | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
| Line 836: | Line 950: | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===SpinRight=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EncoderReadCount''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SpinRight''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Reads one of themotor encoder counters. Each encoder count is equal to 0.314159 mm.   | + | | colspan="2" | Spins the formula flowcode on the spot in a clockwise direction as seen from above.   | 
|  | |- |  | |- | 
|  | |- |  | |- | 
|  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" | Channel | + | | width="90%" | Power | 
|  | |- |  | |- | 
| − | | colspan="2" | 0 = LeftCount, 1=RightCount  | + | | colspan="2" | Amount of power to use to drive motor. Range 0-100  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] -UINT | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
|  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
|  | |} |  | |} | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===Stop=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckUSB''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Stop''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Checks to see if a USB cable is connected to the robot. Returns 0 for no connection and 1 for an active connection.  | + | | colspan="2" | Stops both motors.  | 
|  | |- |  | |- | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] -BYTE | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
|  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |  | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | 
|  | |} |  | |} | 
|  |  |  |  | 
|  |  |  |  | 
|  | + | ===WaitForSwitch=== | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |  | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDSetForegroundColour''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WaitForSwitch''' | 
|  | |- |  | |- | 
| − | | colspan="2" | Sets thepixel colour todrive the LCD. Default colour is 1 where a set pixel is black and the background is white.  | + | | colspan="2" | Waits for the specified switch to be pressed.  | 
|  | |- |  | |- | 
|  | |- |  | |- | 
|  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |  | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | 
| − | | width="90%" | Colour | + | | width="90%" | Switch | 
|  | |- |  | |- | 
| − | | colspan="2" | Range 0-1: 0=White,1=Black  | + | | colspan="2" | Which switch do we want to wait for 0=Left, 1=Right, 2=Either, 3=Both  | 
|  | |- |  | |- | 
|  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |  | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | 
| Line 884: | Line 1,001: | 
|  | |} |  | |} | 
|  |  |  |  | 
|  | + |  | 
|  | + | ==Property reference== | 
|  |  |  |  | 
|  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | + | | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''   | 
|  | |- |  | |- | 
| − | | colspan="2" | Starts up the Formula Allcode PWM for motor control and performs the wait for button press if enabled. 
 |  | 
|  | |- |  | |- | 
|  | + | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | 
|  | + | | width="90%" | Wait For Button | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" |[[File:Fc9-void-icon.png]] - VOID | + | | colspan="2" | Determines if the program will automatically wait for one of the front switches to be pressed before executing the program. Ran as part of the initialise function after the various components have been initialised.  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" |'''LogoSetSpeed''' | + | | width="90%" | Show Creation Info | 
|  | |- |  | |- | 
| − | | colspan="2" | Sets thecruise speed for LOGO type macros.Default speed 20%.  | + | | colspan="2" | Specifies what information is shown to the user on calling the initialise function. The time and date shown are the compilation time and date to help pinpoint the firmware version.  | 
|  | |- |  | |- | 
|  | + | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | 
|  | + | | width="90%" | Bluetooth Reset | 
|  | |- |  | |- | 
| − | | width="10%" align="center" |[[File:Fc9-u8-icon.png]] - BYTE | + | | colspan="2" | Decides if the Bluetooth data connection can reset the Formula AllCode. Used by mLoader when programming via Bluetooth to allow reprogramming without having to physically touch the robot. To ensure programming security set this option to No.  | 
| − | | width="90%" | Speed
 |  | 
|  | |- |  | |- | 
| − | | colspan="2" |Range 1-100, Default 60  | + | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | 
|  | + | | width="90%" | Use Motor Feedback | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="border-top:2px solid #000;" | [[File:Fc9-void-icon.png]]- VOID | + | | colspan="2" | Controls when the motor feedback is used. No - Speed control feedback is not used for SetMotors commands. Yes - Speed control feedback is used for the SetMotors commands. SetMotors commands include Forward, Backward, SpinLeft, SpinRight as well as SetMotors itself. Logo functions always use feedback.  | 
| − | | width="90%" style="border-top:2px solid #000;" | ''Return'' | + | |- | 
| − | |}
 | + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | 
| − |   | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | IR Simulation | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LogoForwards'''
 |  | 
|  | |- |  | |- | 
| − | | colspan="2" |Drives the robot forward using the encoders as feedback to ensure the robot drives straight.Automatically stops at the specified distance.  | + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | 
|  | + | | width="90%" | IR Simulation Mode | 
|  | |- |  | |- | 
|  | + | | colspan="2" | Controls how the IR sensors are modelled in simulation. Linear is the legacy mode and works as it has always done. Exponential attempts to provide a more accurate reading which is closed to response of the real world hardware,  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]]- UINT | + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | 
| − | | width="90%" | Distance | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | IR Thresholds (CheckIR macro) | 
|  | |- |  | |- | 
| − | | colspan="2" | Distance you want to robot to drive in mm. Range 1-65535 
 |  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]]- VOID | + | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | 
| − | | width="90%" style="border-top: 2px solid #000;" |''Return'' | + | | width="90%" | IR Distance | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" |[[File:Fc9-comp-macro.png]] | + | | colspan="2" | IR Threshold used with the CheckIR macro  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDClear'''
 |  | 
|  | |- |  | |- | 
| − | | colspan="2" |Clears the contents of the graphical LCD.  | + | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | 
|  | + | | width="90%" | Line Sensitivity | 
|  | |- |  | |- | 
|  | + | | colspan="2" |   | 
|  | + | |- | 
|  | + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | 
|  | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation Properties | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − | 
 |  | 
| − | 
 |  | 
| − | 
 |  | 
| − | 
 |  | 
| − | ==Property reference==
 |  | 
| − | 
 |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]] | + | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  | + | | width="90%" | Sim Speed (1 - 100) | 
|  | |- |  | |- | 
|  | + | | colspan="2" | Sets the simulated amount of movement relative to the speed of the Formula Allcode.  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | + | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | 
| − | | width="90%" | Wait For Button | + | | width="90%" | Timer Interval (ms) | 
|  | |- |  | |- | 
| − | | colspan="2" | Determines if the program will automatically wait for one of thefront switches to be pressed before executing the program. Ran as part of the initialise function after the various components have been initialised.  | + | | colspan="2" | Interval in milliseconds between each simulated movement of the Formula Allcode robot.  | 
|  | |- |  | |- | 
|  | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] |  | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | 
| − | | width="90%" | Show Creation Info | + | | width="90%" | Collision Method | 
|  | |- |  | |- | 
| − | | colspan="2" | Specifies what information is shown to theuser on calling the initialise function. The time and date shown are the compilation time and date to help pinpoint the firmware version.  | + | | colspan="2" | Select which objects the robot sensors will interact with.  | 
|  | |- |  | |- | 
| − | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 | + | | width="10%" align="center" | [[File:Fc9-type-17-icon.png]] | 
| − | | width="90%" | Bluetooth Reset
 | + | | width="90%" | Light Source | 
| − | |-
 |  | 
| − | | colspan="2" | Decides if the Bluetooth data connection can reset the Formula AllCode. Used by mLoader when programming via Bluetooth to allow reprogramming without having to physically touch the robot. To ensure programming security set this option to No. 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 |  | 
| − | | width="90%" | Use Motor Feedback
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Controls when the motor feedback is used. No - Speed control feedback is not used for SetMotors commands. Yes - Speed control feedback is used for the SetMotors commands. SetMotors commands include Forward, Backward, SpinLeft, SpinRight as well as SetMotors itself. Logo functions always use feedback. 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 |  | 
| − | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | IR Simulation
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 |  | 
| − | | width="90%" | IR Simulation Mode
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Controls how the IR sensors are modelled in simulation. Linear is the legacy mode and works as it has always done. Exponential attempts to provide a more accurate reading which is closed to response of the real world hardware, 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 |  | 
| − | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | IR Thresholds (CheckIR macro)
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 |  | 
| − | | width="90%" | IR Distance
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | IR Threshold used with the CheckIR macro 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 |  | 
| − | | width="90%" | Line Sensitivity
 |  | 
| − | |-
 |  | 
| − | | colspan="2" |  
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 |  | 
| − | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation Properties
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 |  | 
| − | | width="90%" | Sim Speed (1 - 100)
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Sets the simulated amount of movement relative to the speed of the Formula Allcode. 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 |  | 
| − | | width="90%" | Timer Interval (ms)
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Interval in milliseconds between each simulated movement of the Formula Allcode robot. 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 |  | 
| − | | width="90%" | Collision Method
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Select which objects the robot sensors will interact with. 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 |  | 
| − | | width="90%" | Light Source
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Panel object specified as the simulation light source. Used when simulating "find the light" type tasks. 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 |  | 
| − | | width="90%" | Addon Mechanics
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Useful if you are creating add-ons to the robot which you want to be able to simulate. Point the property at the group containing the Formula Allcode and the additional mechanics. Otherwise leave blank to maintain the normal simulation functionality. 
 |  | 
| − | |}==Macro reference==
 |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PlayNote'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Outputs a single tone from the onboard speaker for the period specified. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" | Note
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Sets the pitch of the note in Hz. Range: 1 - 10000 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" | Time
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Time period to play the note for in milliseconds. Range: 0 - 65535 ms 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LEDOn'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Switches on a single LED on the front of the Formula Allcode.  
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | LED
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Which LED to switch on, range 0-7 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''BluetoothTransmit'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Sends a byte via the Bluetooth data connection. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Data
 |  | 
| − | |-
 |  | 
| − | | colspan="2" |  
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDPrintString'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Prints a string to the graphical LCD. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | X
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | The horizontal start pixel. Range 0-127 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Y
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Y coordinate to print the string. Range 0-31 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 |  | 
| − | | width="90%" | Data
 |  | 
| − | |-
 |  | 
| − | | colspan="2" |  
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" | Transparent
 |  | 
| − | |-
 |  | 
| − | | colspan="2" |  
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LogoConfigure'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | The Logo movement may sometimes be slightly off in terms of distance or angle. Before tweaking the factory values check that the wheels are pushed well onto their shafts but not tight against the FA body. Also check the tyre is on the wheel correctly.  
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 |  | 
| − | | width="90%" | Distance
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | mm per encoder step. default = 0.32 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 |  | 
| − | | width="90%" | Angle
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | mm of travel per degree. default = 0.7295 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Stop'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Stops both motors. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadBattery'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Reads the current voltage level from the LiPo battery. Return value is the battery voltage in Volts. Take care not to run the battery too low.  Voltages lower than 3.4V may damage the battery. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LEDOff'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Switches off a single LED on the front of the Formula Allcode.  
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | LED
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Which LED to switch on, range 0-7 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDPrintNumber'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Prints a numeric value to the graphical LCD. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | X
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | The horizontal start pixel. Range 0-127 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Y
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Y coordinate to print the string. Range 0-31 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" | Number
 |  | 
| − | |-
 |  | 
| − | | colspan="2" |  
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Transparent
 |  | 
| − | |-
 |  | 
| − | | colspan="2" |  
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LEDWrite'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Allows control of all 8-LEDs on the front of the Formula Allcode.  
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | LED_Byte
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | 8-bit binary value to write to the 8 LEDs 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''BluetoothCheckConnection'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Checks the status of the Bluetooth connection. Returns 0 for not paired and 1 for paired. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadMic'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Reads the current audio signal level from the on-board microphone.  Return value range: 0 to 4095 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AudioQueueLength'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Retreives the current length of valid data within the audio queue 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AudioAddToBuffer'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Writes a value to the 16-bit audio output buffer. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" | Data
 |  | 
| − | |-
 |  | 
| − | | colspan="2" |  
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadSwitch'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Reads the value of one of the switches from the front of the Formula Allcode. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Switch
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Which switch do we want to read 0=Left, 1=Right 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckLine'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Checks to see if a line sensor is within the master threshold distance. Returns 0 if the IR reading is below the threshold. Returns 1 if the IR reading is greater than or equal to the threshold. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Sensor
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range: 0 to 1 - 0=Left, 1=Right 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AudioStreamControl'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Allows control of the audio output functionality via the onboard speaker. Data is loaded into the audio output buffer using the AddToBuffer function. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Mode
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | 0=Off, 8=8-bit Mode, 16=16-bit Mode 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | SampleRate
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Sets the sample rate 0=8KHz, 1=16KHz 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SpinLeft'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Spins the formula flowcode on the spot in an anticlockwise direction as seen from above.  
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Power
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Amount of power to use to drive motor. Range 0-100 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LogoTurnLeft'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Rotates the robot left by a specific angle using the encoders as feedback to ensure the robot turns evenly. Automatically stops at the specified turn angle. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" | Angle
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Angle in degrees you wish to rotate. Range 1-65536 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Forward'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Drives both motors of the formula flowcode forwards with the power specified.  
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Power
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Amount of power to use to drive motor. Range 0-100 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDWriteByte'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" |  
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Data
 |  | 
| − | |-
 |  | 
| − | | colspan="2" |  
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | X
 |  | 
| − | |-
 |  | 
| − | | colspan="2" |  
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Y
 |  | 
| − | |-
 |  | 
| − | | colspan="2" |  
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''BluetoothReceive'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Attempt to read a byte from the Bluetooth receive queue. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDDrawLine'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Draws a line on the LCD. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | X1
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range 0-127 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Y1
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range 0-31 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | X2
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range 0-127 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Y2
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range 0-31 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''BluetoothQueueLength'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Reads the length of received Bluetooth data in bytes.  
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''BluetoothTransmitString'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Sends a string via the Bluetooth data connection. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 |  | 
| − | | width="90%" | Data
 |  | 
| − | |-
 |  | 
| − | | colspan="2" |  
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDBacklight'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Controls the brighness of the LCD backlight 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Brightness
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range: 0-100, 0=Off, 1=Min Brightness, 100=Max Brightness 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AudioReadFromBuffer'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Allows the audio buffer to be used for other streaming data such as recording the mic.  
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadLineSensor'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Reads the analogue value from the specified IR line sensor. Return value range: 0 to 4095 4095 represents the object is reflecting the most light. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Channel
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range: 0 to 1 - 0=Left, 1=Right 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LogoTurnRight'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Rotates the robot right by a specific angle using the encoders as feedback to ensure the robot turns evenly. Automatically stops at the specified turn angle. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" | Angle
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Angle in degrees you wish to rotate. Range 1-65536 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SpinRight'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Spins the formula flowcode on the spot in a clockwise direction as seen from above.  
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Power
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Amount of power to use to drive motor. Range 0-100 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckIR'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Checks to see if a IR sensor is within the master threshold distance. Returns 0 if the IR reading is below the threshold. Returns 1 if the IR reading is greater than or equal to the threshold. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Sensor
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range: 0 to 7 - 0=Left, 1=Front Left, 2=Front, 3=Front Right, 4=Right, 5=Rear Right, 6=Rear, 7=Rear Left 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDPlotPixel'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Allows a single pixel on the LCD to be set or cleared. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | X
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Sets the X coordinate - Range 0-127 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Y
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Sets the Y coordinate - Range 0-31 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDSetBackgroundColour'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Sets the pixel colour to drive the LCD. Default colour is 1 where a set pixel is black and the background is white. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Colour
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range 0-1 : 0=White, 1=Black 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadIRSensor'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Reads the analogue value from the specified IR distance sensor. Return value range: 0 to 4095 4095 represents the object is very close. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Channel
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range: 0 to 7 - 0=Left, 1=Front Left, 2=Front, 3=Front Right, 4=Right, 5=Rear Right, 6=Rear, 7=Rear Left 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetMotors'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Sets the speed and direction of the Formula Allcode motors.  
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT
 |  | 
| − | | width="90%" | Left
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Valid Range = -100 to 100 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT
 |  | 
| − | | width="90%" | Right
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Valid Range = -100 to 100 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LogoBackwards'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Drives the robot backward using the encoders as feedback to ensure the robot drives straight. Automatically stops at the specified distance. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" | Distance
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Distance you want to robot to drive in mm. Range 1-65535 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EncoderReset'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Resets the encoder counters to 0 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Reverse'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Drives both motors of the formula flowcode backwards with the power specified.  
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Power
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Amount of power to use to drive motor. Range 0-100 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WaitForSwitch'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Waits for the specified switch to be pressed. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Switch
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Which switch do we want to wait for 0=Left, 1=Right, 2=Either, 3=Both 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadLDR'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Reads the current light level from the on board light sensor. Return value range: 0 to 4095 4095 represents the maximum level of light and 0 represents the minimal level of light. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDDrawRectangle'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Draws a rectange on the LCD. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | X1
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range 0-127 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Y1
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range 0-31 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | X2
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range 0-127 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Y2
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range 0-31 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Transparent
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Sets the transparency of the box, 0=Box contains background colour, 1=Box contains previous pixel data 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Solid
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Chooses to fill the box with colour, 0=Box contains transparency data, 1=Box contains foreground colour 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EncoderReadCount'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Reads one of the motor encoder counters. Each encoder count is equal to 0.314159 mm.  
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Channel
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | 0 = LeftCount, 1=RightCount 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckUSB'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Checks to see if a USB cable is connected to the robot. Returns 0 for no connection and 1 for an active connection. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDSetForegroundColour'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Sets the pixel colour to drive the LCD. Default colour is 1 where a set pixel is black and the background is white. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Colour
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range 0-1 : 0=White, 1=Black 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Starts up the Formula Allcode PWM for motor control and performs the wait for button press if enabled. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LogoSetSpeed'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Sets the cruise speed for LOGO type macros. Default speed 20%. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Speed
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range 1-100, Default 60 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LogoForwards'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Drives the robot forward using the encoders as feedback to ensure the robot drives straight. Automatically stops at the specified distance. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" | Distance
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Distance you want to robot to drive in mm. Range 1-65535 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDClear'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Clears the contents of the graphical LCD. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − |   |  | 
| − |   |  | 
| − | ==Property reference==
 |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties''' 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 |  | 
| − | | width="90%" | Wait For Button
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Determines if the program will automatically wait for one of the front switches to be pressed before executing the program. Ran as part of the initialise function after the various components have been initialised. 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 |  | 
| − | | width="90%" | Show Creation Info
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Specifies what information is shown to the user on calling the initialise function. The time and date shown are the compilation time and date to help pinpoint the firmware version. 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 |  | 
| − | | width="90%" | Bluetooth Reset
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Decides if the Bluetooth data connection can reset the Formula AllCode. Used by mLoader when programming via Bluetooth to allow reprogramming without having to physically touch the robot. To ensure programming security set this option to No. 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 |  | 
| − | | width="90%" | Use Motor Feedback
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Controls when the motor feedback is used. No - Speed control feedback is not used for SetMotors commands. Yes - Speed control feedback is used for the SetMotors commands. SetMotors commands include Forward, Backward, SpinLeft, SpinRight as well as SetMotors itself. Logo functions always use feedback. 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 |  | 
| − | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | IR Simulation
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 |  | 
| − | | width="90%" | IR Simulation Mode
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Controls how the IR sensors are modelled in simulation. Linear is the legacy mode and works as it has always done. Exponential attempts to provide a more accurate reading which is closed to response of the real world hardware, 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 |  | 
| − | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | IR Thresholds (CheckIR macro)
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 |  | 
| − | | width="90%" | IR Distance
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | IR Threshold used with the CheckIR macro 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 |  | 
| − | | width="90%" | Line Sensitivity
 |  | 
| − | |-
 |  | 
| − | | colspan="2" |  
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 |  | 
| − | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation Properties
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 |  | 
| − | | width="90%" | Sim Speed (1 - 100)
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Sets the simulated amount of movement relative to the speed of the Formula Allcode. 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 |  | 
| − | | width="90%" | Timer Interval (ms)
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Interval in milliseconds between each simulated movement of the Formula Allcode robot. 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 |  | 
| − | | width="90%" | Collision Method
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Select which objects the robot sensors will interact with. 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 |  | 
| − | | width="90%" | Light Source
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Panel object specified as the simulation light source. Used when simulating "find the light" type tasks. 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 |  | 
| − | | width="90%" | Addon Mechanics
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Useful if you are creating add-ons to the robot which you want to be able to simulate. Point the property at the group containing the Formula Allcode and the additional mechanics. Otherwise leave blank to maintain the normal simulation functionality. 
 |  | 
| − | |}==Macro reference==
 |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PlayNote'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Outputs a single tone from the onboard speaker for the period specified. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" | Note
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Sets the pitch of the note in Hz. Range: 1 - 10000 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" | Time
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Time period to play the note for in milliseconds. Range: 0 - 65535 ms 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LEDOn'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Switches on a single LED on the front of the Formula Allcode.  
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | LED
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Which LED to switch on, range 0-7 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''BluetoothTransmit'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Sends a byte via the Bluetooth data connection. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Data
 |  | 
| − | |-
 |  | 
| − | | colspan="2" |  
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDPrintString'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Prints a string to the graphical LCD. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | X
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | The horizontal start pixel. Range 0-127 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Y
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Y coordinate to print the string. Range 0-31 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 |  | 
| − | | width="90%" | Data
 |  | 
| − | |-
 |  | 
| − | | colspan="2" |  
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" | Transparent
 |  | 
| − | |-
 |  | 
| − | | colspan="2" |  
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LogoConfigure'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | The Logo movement may sometimes be slightly off in terms of distance or angle. Before tweaking the factory values check that the wheels are pushed well onto their shafts but not tight against the FA body. Also check the tyre is on the wheel correctly.  
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 |  | 
| − | | width="90%" | Distance
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | mm per encoder step. default = 0.32 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 |  | 
| − | | width="90%" | Angle
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | mm of travel per degree. default = 0.7295 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Stop'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Stops both motors. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadBattery'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Reads the current voltage level from the LiPo battery. Return value is the battery voltage in Volts. Take care not to run the battery too low.  Voltages lower than 3.4V may damage the battery. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LEDOff'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Switches off a single LED on the front of the Formula Allcode.  
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | LED
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Which LED to switch on, range 0-7 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDPrintNumber'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Prints a numeric value to the graphical LCD. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | X
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | The horizontal start pixel. Range 0-127 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Y
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Y coordinate to print the string. Range 0-31 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" | Number
 |  | 
| − | |-
 |  | 
| − | | colspan="2" |  
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Transparent
 |  | 
| − | |-
 |  | 
| − | | colspan="2" |  
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LEDWrite'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Allows control of all 8-LEDs on the front of the Formula Allcode.  
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | LED_Byte
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | 8-bit binary value to write to the 8 LEDs 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''BluetoothCheckConnection'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Checks the status of the Bluetooth connection. Returns 0 for not paired and 1 for paired. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadMic'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Reads the current audio signal level from the on-board microphone.  Return value range: 0 to 4095 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AudioQueueLength'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Retreives the current length of valid data within the audio queue 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AudioAddToBuffer'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Writes a value to the 16-bit audio output buffer. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" | Data
 |  | 
| − | |-
 |  | 
| − | | colspan="2" |  
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadSwitch'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Reads the value of one of the switches from the front of the Formula Allcode. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Switch
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Which switch do we want to read 0=Left, 1=Right 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckLine'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Checks to see if a line sensor is within the master threshold distance. Returns 0 if the IR reading is below the threshold. Returns 1 if the IR reading is greater than or equal to the threshold. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Sensor
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range: 0 to 1 - 0=Left, 1=Right 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AudioStreamControl'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Allows control of the audio output functionality via the onboard speaker. Data is loaded into the audio output buffer using the AddToBuffer function. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Mode
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | 0=Off, 8=8-bit Mode, 16=16-bit Mode 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | SampleRate
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Sets the sample rate 0=8KHz, 1=16KHz 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SpinLeft'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Spins the formula flowcode on the spot in an anticlockwise direction as seen from above.  
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Power
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Amount of power to use to drive motor. Range 0-100 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LogoTurnLeft'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Rotates the robot left by a specific angle using the encoders as feedback to ensure the robot turns evenly. Automatically stops at the specified turn angle. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" | Angle
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Angle in degrees you wish to rotate. Range 1-65536 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Forward'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Drives both motors of the formula flowcode forwards with the power specified.  
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Power
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Amount of power to use to drive motor. Range 0-100 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDWriteByte'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" |  
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Data
 |  | 
| − | |-
 |  | 
| − | | colspan="2" |  
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | X
 |  | 
| − | |-
 |  | 
| − | | colspan="2" |  
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Y
 |  | 
| − | |-
 |  | 
| − | | colspan="2" |  
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''BluetoothReceive'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Attempt to read a byte from the Bluetooth receive queue. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDDrawLine'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Draws a line on the LCD. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | X1
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range 0-127 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Y1
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range 0-31 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | X2
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range 0-127 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Y2
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range 0-31 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''BluetoothQueueLength'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Reads the length of received Bluetooth data in bytes.  
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''BluetoothTransmitString'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Sends a string via the Bluetooth data connection. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 |  | 
| − | | width="90%" | Data
 |  | 
| − | |-
 |  | 
| − | | colspan="2" |  
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDBacklight'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Controls the brighness of the LCD backlight 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Brightness
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range: 0-100, 0=Off, 1=Min Brightness, 100=Max Brightness 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AudioReadFromBuffer'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Allows the audio buffer to be used for other streaming data such as recording the mic.  
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadLineSensor'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Reads the analogue value from the specified IR line sensor. Return value range: 0 to 4095 4095 represents the object is reflecting the most light. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Channel
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range: 0 to 1 - 0=Left, 1=Right 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LogoTurnRight'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Rotates the robot right by a specific angle using the encoders as feedback to ensure the robot turns evenly. Automatically stops at the specified turn angle. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" | Angle
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Angle in degrees you wish to rotate. Range 1-65536 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SpinRight'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Spins the formula flowcode on the spot in a clockwise direction as seen from above.  
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Power
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Amount of power to use to drive motor. Range 0-100 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckIR'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Checks to see if a IR sensor is within the master threshold distance. Returns 0 if the IR reading is below the threshold. Returns 1 if the IR reading is greater than or equal to the threshold. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Sensor
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range: 0 to 7 - 0=Left, 1=Front Left, 2=Front, 3=Front Right, 4=Right, 5=Rear Right, 6=Rear, 7=Rear Left 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDPlotPixel'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Allows a single pixel on the LCD to be set or cleared. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | X
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Sets the X coordinate - Range 0-127 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Y
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Sets the Y coordinate - Range 0-31 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDSetBackgroundColour'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Sets the pixel colour to drive the LCD. Default colour is 1 where a set pixel is black and the background is white. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Colour
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range 0-1 : 0=White, 1=Black 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadIRSensor'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Reads the analogue value from the specified IR distance sensor. Return value range: 0 to 4095 4095 represents the object is very close. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Channel
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range: 0 to 7 - 0=Left, 1=Front Left, 2=Front, 3=Front Right, 4=Right, 5=Rear Right, 6=Rear, 7=Rear Left 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetMotors'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Sets the speed and direction of the Formula Allcode motors.  
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT
 |  | 
| − | | width="90%" | Left
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Valid Range = -100 to 100 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT
 |  | 
| − | | width="90%" | Right
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Valid Range = -100 to 100 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LogoBackwards'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Drives the robot backward using the encoders as feedback to ensure the robot drives straight. Automatically stops at the specified distance. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" | Distance
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Distance you want to robot to drive in mm. Range 1-65535 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EncoderReset'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Resets the encoder counters to 0 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Reverse'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Drives both motors of the formula flowcode backwards with the power specified.  
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Power
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Amount of power to use to drive motor. Range 0-100 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WaitForSwitch'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Waits for the specified switch to be pressed. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Switch
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Which switch do we want to wait for 0=Left, 1=Right, 2=Either, 3=Both 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadLDR'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Reads the current light level from the on board light sensor. Return value range: 0 to 4095 4095 represents the maximum level of light and 0 represents the minimal level of light. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDDrawRectangle'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Draws a rectange on the LCD. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | X1
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range 0-127 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Y1
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range 0-31 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | X2
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range 0-127 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Y2
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range 0-31 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Transparent
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Sets the transparency of the box, 0=Box contains background colour, 1=Box contains previous pixel data 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Solid
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Chooses to fill the box with colour, 0=Box contains transparency data, 1=Box contains foreground colour 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EncoderReadCount'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Reads one of the motor encoder counters. Each encoder count is equal to 0.314159 mm.  
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Channel
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | 0 = LeftCount, 1=RightCount 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckUSB'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Checks to see if a USB cable is connected to the robot. Returns 0 for no connection and 1 for an active connection. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDSetForegroundColour'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Sets the pixel colour to drive the LCD. Default colour is 1 where a set pixel is black and the background is white. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Colour
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range 0-1 : 0=White, 1=Black 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Starts up the Formula Allcode PWM for motor control and performs the wait for button press if enabled. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LogoSetSpeed'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Sets the cruise speed for LOGO type macros. Default speed 20%. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 |  | 
| − | | width="90%" | Speed
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Range 1-100, Default 60 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LogoForwards'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Drives the robot forward using the encoders as feedback to ensure the robot drives straight. Automatically stops at the specified distance. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 |  | 
| − | | width="90%" | Distance
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Distance you want to robot to drive in mm. Range 1-65535 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDClear'''
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Clears the contents of the graphical LCD. 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 |  | 
| − | | width="90%" style="border-top: 2px solid #000;" | ''Return''
 |  | 
| − | |}
 |  | 
| − |   |  | 
| − |   |  | 
| − |   |  | 
| − |   |  | 
| − | ==Property reference==
 |  | 
| − |   |  | 
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 |  | 
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties''' 
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 |  | 
| − | | width="90%" | Wait For Button
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Determines if the program will automatically wait for one of the front switches to be pressed before executing the program. Ran as part of the initialise function after the various components have been initialised. 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 |  | 
| − | | width="90%" | Show Creation Info
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Specifies what information is shown to the user on calling the initialise function. The time and date shown are the compilation time and date to help pinpoint the firmware version. 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 |  | 
| − | | width="90%" | Bluetooth Reset
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Decides if the Bluetooth data connection can reset the Formula AllCode. Used by mLoader when programming via Bluetooth to allow reprogramming without having to physically touch the robot. To ensure programming security set this option to No. 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 |  | 
| − | | width="90%" | Use Motor Feedback
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Controls when the motor feedback is used. No - Speed control feedback is not used for SetMotors commands. Yes - Speed control feedback is used for the SetMotors commands. SetMotors commands include Forward, Backward, SpinLeft, SpinRight as well as SetMotors itself. Logo functions always use feedback. 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 |  | 
| − | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | IR Simulation
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 |  | 
| − | | width="90%" | IR Simulation Mode
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Controls how the IR sensors are modelled in simulation. Linear is the legacy mode and works as it has always done. Exponential attempts to provide a more accurate reading which is closed to response of the real world hardware, 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 |  | 
| − | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | IR Thresholds (CheckIR macro)
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 |  | 
| − | | width="90%" | IR Distance
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | IR Threshold used with the CheckIR macro 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 |  | 
| − | | width="90%" | Line Sensitivity
 |  | 
| − | |-
 |  | 
| − | | colspan="2" |  
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 |  | 
| − | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation Properties
 |  | 
| − | |-
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 |  | 
| − | | width="90%" | Sim Speed (1 - 100)
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Sets the simulated amount of movement relative to the speed of the Formula Allcode. 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 |  | 
| − | | width="90%" | Timer Interval (ms)
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Interval in milliseconds between each simulated movement of the Formula Allcode robot. 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 |  | 
| − | | width="90%" | Collision Method
 |  | 
| − | |-
 |  | 
| − | | colspan="2" | Select which objects the robot sensors will interact with. 
 |  | 
| − | |-
 |  | 
| − | | width="10%" align="center" | [[File:Fc9-type-17-icon.png]] |  | 
| − | | width="90%" | Light Source |  | 
|  | |- |  | |- | 
|  | | colspan="2" | Panel object specified as the simulation light source. Used when simulating "find the light" type tasks.  |  | | colspan="2" | Panel object specified as the simulation light source. Used when simulating "find the light" type tasks.  | 
| Line 3,003: | Line 1,082: | 
|  | | colspan="2" | Useful if you are creating add-ons to the robot which you want to be able to simulate. Point the property at the group containing the Formula Allcode and the additional mechanics. Otherwise leave blank to maintain the normal simulation functionality.  |  | | colspan="2" | Useful if you are creating add-ons to the robot which you want to be able to simulate. Point the property at the group containing the Formula Allcode and the additional mechanics. Otherwise leave blank to maintain the normal simulation functionality.  | 
|  | |} |  | |} | 
|  | + |  | 
|  | + | ==Component Source Code== | 
|  | + |  | 
|  | + | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_FA_Source_P4.fcfx FC_Comp_Source_FA_Source_P4.fcfx] | 
|  | + |  | 
|  | + | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_FA_Source_P4.fcfx FC_Comp_Source_FA_Source_P4.fcfx] |