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

From Flowcode Help
Jump to navigationJump to search
 
(9 intermediate revisions by one other user not shown)
Line 17: Line 17:
 
==Component Source Code==
 
==Component Source Code==
  
Please click here for the component source code: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_FormulaAllCode_API.fcsx FC_Comp_Source_FormulaAllCode_API.fcsx]
+
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_FormulaAllCode_API.fcsx FC_Comp_Source_FormulaAllCode_API.fcsx]
 +
 
 +
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_FormulaAllCode_API.fcsx FC_Comp_Source_FormulaAllCode_API.fcsx]
  
 
==Detailed description==
 
==Detailed description==
Line 33: Line 35:
  
  
''No detailed description exists yet for this component''
 
  
==Examples==
 
  
  
Line 41: Line 41:
  
  
 +
 +
 +
 +
 +
''No detailed description exists yet for this component''
 +
 +
==Examples==
  
  
Line 51: Line 58:
  
  
The COM port for the Formula AllCode can be set via the panel properties which can be exposed to the SCADA runtime user.
 
  
  
===LED Control===
 
  
Controls the LEDs on the Formula AllCode by collecting the analogue value of a potentiometer on the simulation panel and sending the value to the robot.
 
  
{{Fcfile|LEDcontrol.fcfx|LED Control Example}}
 
  
  
===Motor Control Using Keypad===
 
  
Uses the keypad on the simulation panel to control the speed and direction of the motors. Key 2 drives the robot forwards, 8 drives backwards, 4 and 6 turn the robot on the spot.
 
  
{{Fcfile|MotorControl.fcfx|Motor Control Example}}
 
  
  
===Motor Control Using Joystick===
 
  
A simple example showing how to drive the Formula AllCode robot around in API mode using a panel based joystick control.
 
  
{{Fcfile|Formula_AllCode_Bluetooth.fcsx|Formula AllCode Bluetooth}}
 
  
  
===Proximity Alarm===
 
  
Reads the front IR sensor on the Formula AllCode from the Flowcode simulation. If a near object is sensed then the Flowcode simulation will speak the word "Hello" using the Speech component.
 
  
{{Fcfile|ProximityAlarm.fcfx|Proximity Alarm Example}}
 
  
  
===Driving Simulation using the API component===
 
  
An example showing how to use the API component to drive the Formula AllCode robot component on the simulation panel.
 
  
{{Fcfile|FA_API_Sim_Demo.fcfx|FA API Sim Demo}}
 
  
  
===JCB Bot Blog===
 
  
Blog with example code showing how to drive the Formula AllCode robot using Key Mappings and how to add extra features such as a 3D printed cover and servo motors to operate a digger arm and bucket.
 
  
[https://www.matrixtsl.com/blog/jcbbot-customising-the-formula-allcode-robot/ JCB Bot]
 
  
==Downloadable macro reference==
 
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
''<span style="color:red;">No additional examples</span>''
|-
 
| 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" | Plays a note using the speaker on the FA&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Note
 
|-
 
| colspan="2" | Range 1 to 65535 in Hz&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Delay
 
|-
 
| colspan="2" | Number of milliseconds to play the note for&nbsp;
 
|-
 
| 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''
 
|}
 
  
 +
==Macro reference==
  
 +
===Backwards===
 
{| 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;" | '''Backwards'''
 
|-
 
|-
| colspan="2" | Sets a single LED 0-7&nbsp;
+
| colspan="2" | Drives the robot backwards - waits for the distance to be traversed before returning&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | index
+
| width="90%" | Distance
 
|-
 
|-
| colspan="2" | Range: 0-7&nbsp;
+
| colspan="2" | Distance in mm&nbsp;
 
|-
 
|-
 
| 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 138: Line 107:
  
  
 +
===CardBitmap===
 
{| 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;" | '''CardBitmap'''
 
|-
 
|-
| colspan="2" | Prints a string to the LCD&nbsp;
+
| colspan="2" | Displays a monochrome bitmap read from the card on the LCD&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 149: Line 119:
 
| width="90%" | X
 
| width="90%" | X
 
|-
 
|-
| colspan="2" | X Pixel 0-127&nbsp;
+
| colspan="2" | Range 0-127&nbsp;
 
|-
 
|-
 
| 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%" | Y
 
|-
 
|-
| colspan="2" | LCD Y Coordinate 0-31&nbsp;
+
| colspan="2" | Range 0-31&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Data
+
| width="90%" | Filename
 
|-
 
|-
 
| colspan="2" | &nbsp;
 
| colspan="2" | &nbsp;
 
|-
 
|-
| 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''
 
|}
 
|}
  
  
 +
===CardCreate===
 
{| 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;" | '''ReadLight'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardCreate'''
 +
|-
 +
| colspan="2" | Attempts to create a file on the SD card 255=Error, 1=File Already Exists, 0=Create OK&nbsp;
 +
|-
 
|-
 
|-
| colspan="2" | Reads the light sensor 0-4095 - 4095 = Max Brightness&nbsp;
+
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | Filename
 
|-
 
|-
 +
| colspan="2" | &nbsp;
 
|-
 
|-
| 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-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===CardErase===
 
{| 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;" | '''Right'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardErase'''
 
|-
 
|-
| colspan="2" | Rotates the robot right - waits for the angle to be traversed before returning&nbsp;
+
| colspan="2" | Attempts to delete an existing file on the SD card 255=Error, 1=File not found, 0=Delete OK&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
+
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Angle
+
| width="90%" | Filename
 
|-
 
|-
| colspan="2" | Angle to turn in degrees&nbsp;
+
| colspan="2" | &nbsp;
 
|-
 
|-
| 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''
 
|}
 
|}
  
  
 +
===CardInit===
 
{| 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;" | '''SetLogoSpeed'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardInit'''
 
|-
 
|-
| colspan="2" | Sets the speed of logo movements&nbsp;
+
| colspan="2" | Attempts to startup the SD card  255=No Card, 254=Init Fail, 0=Init OK&nbsp;
 
|-
 
|-
 
|-
 
|-
| 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%" | Speed
 
|-
 
| colspan="2" | Logo Speed 1-100 - Default 40&nbsp;
 
|-
 
| 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''
 
|}
 
|}
  
  
 +
===CardOpen===
 
{| 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;" | '''ReadAllSensors'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardOpen'''
 +
|-
 +
| colspan="2" | Attempts to open an existing file on the SD card 255=Error, 1=File not found, 0=Open OK&nbsp;
 +
|-
 
|-
 
|-
| colspan="2" | Samples all of the robot's sensors at once, storing the values locally&nbsp;
+
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | Filename
 
|-
 
|-
 +
| colspan="2" | &nbsp;
 
|-
 
|-
| 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''
 
|}
 
|}
  
  
 +
===CardPlayback===
 
{| 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;" | '''SampleMag'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardPlayback'''
 +
|-
 +
| colspan="2" | Plays back a .Wav file audio stream from the card&nbsp;
 +
|-
 
|-
 
|-
| colspan="2" | Samples the magnetometer 0 = no new data, 1 = new data available&nbsp;
+
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | Filename
 
|-
 
|-
 +
| colspan="2" | &nbsp;
 
|-
 
|-
 
| 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-u8-icon.png]] - BYTE
Line 241: Line 226:
  
  
 +
===CardReadByte===
 
{| 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;" | '''CardCreate'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardReadByte'''
 
|-
 
|-
| colspan="2" | Attempts to create a file on the SD card 255=Error, 1=File Already Exists, 0=Create OK&nbsp;
+
| colspan="2" | Reads a byte from the currently open file. Starts at the beginning of the file and auto increments to the end&nbsp;
 
|-
 
|-
|-
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" | Filename
 
|-
 
| colspan="2" | &nbsp;
 
 
|-
 
|-
 
| 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-u8-icon.png]] - BYTE
Line 259: Line 240:
  
  
 +
===CardRecordMic===
 
{| 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;" | '''CardRecordMic'''
 
|-
 
|-
| colspan="2" | Prints a 16-bit signed number to the LCD&nbsp;
+
| colspan="2" | Records an audio stream on the card from the microphone&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| 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%" | BitDepth
 
|-
 
|-
| colspan="2" | X Pixel 0-127&nbsp;
+
| colspan="2" | 0=8-bit, 1=16-bit&nbsp;
 
|-
 
|-
 
| 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%" | SampleRate
 +
|-
 +
| colspan="2" | Sample Rate 0=8KHz, 1=16KHz&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | RecordTime
 
|-
 
|-
| colspan="2" | LCD Y coordinate 0-31&nbsp;
+
| colspan="2" | Time to record for in seconds, Range 0-65535&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT
+
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Number
+
| width="90%" | Filename
 
|-
 
|-
| colspan="2" | Range -32768 to 32767&nbsp;
+
| colspan="2" | &nbsp;
 
|-
 
|-
| 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''
 
|}
 
|}
  
  
 +
===CardWriteByte===
 
{| 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;" | '''CardWriteByte'''
 
|-
 
|-
| colspan="2" | Clears a single LED 0-7&nbsp;
+
| colspan="2" | Appends a byte to the end of the currently open file &nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | index
+
| width="90%" | Data
 
|-
 
|-
| colspan="2" | Range: 0-7&nbsp;
+
| colspan="2" | &nbsp;
 
|-
 
|-
 
| 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 305: Line 293:
  
  
 +
===EncoderRead===
 
{| 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;" | '''EncoderRead'''
 
|-
 
|-
| colspan="2" | Sets the value of the LEDs as an 8-bit output&nbsp;
+
| colspan="2" | Reads one of the motor encoder counters. Approx 0.328296mm of travel per encoder unit.&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Value
+
| width="90%" | index
 
|-
 
|-
| colspan="2" | LED value 0=All Off, 255 = All On&nbsp;
+
| colspan="2" | 0=Left, 1=Right&nbsp;
 
|-
 
|-
| 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''
 
|}
 
|}
  
  
 +
===EncoderReset===
 
{| 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;" | '''ReadAxis'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EncoderReset'''
 
|-
 
|-
| colspan="2" | Reads a single X/Y/Z axis from the accelerometer sensor. &nbsp;
+
| colspan="2" | Resets the motor encoder counters&nbsp;
 
|-
 
|-
 
|-
 
|-
| 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%" | index
 
|-
 
| colspan="2" | 0=X, 1=Y, 2=Z&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT
 
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===Forwards===
 
{| 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;" | '''ServoSetAutoMoveSpeed'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Forwards'''
 
|-
 
|-
| colspan="2" | Changes the speed of the auto movements  Default - 1&nbsp;
+
| colspan="2" | Drives the robot forwards - waits for the distance to be traversed before returning&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Speed
+
| width="90%" | Distance
 
|-
 
|-
| colspan="2" | Range 1-50&nbsp;
+
| colspan="2" | Distance in mm&nbsp;
 
|-
 
|-
 
| 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 359: Line 345:
  
  
 +
===GetConsoleHandle===
 
{| 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;" | '''CardPlayback'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetConsoleHandle'''
 
|-
 
|-
| colspan="2" | Plays back a .Wav file audio stream from the card&nbsp;
+
| colspan="2" | Gets the handle to the console allowing data displaying on the panel etc.&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-h32-icon.png]] - HANDLE
| width="90%" | Filename
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| 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''
 
|}
 
|}
  
  
 +
===GetProp===
 
{| 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;" | '''GetProp'''
 +
|-
 +
| colspan="2" | Allows the property filter for the COM port list to be copied to a parent component.&nbsp;
 +
|-
 
|-
 
|-
| colspan="2" | Reads the microphone sensor 0 - 4095&nbsp;
+
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | PropName
 
|-
 
|-
 +
| colspan="2" | &nbsp;
 
|-
 
|-
| 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-string-icon.png]] - STRING
 
| 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;" | '''ReadSwitch'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDBacklight'''
 
|-
 
|-
| colspan="2" | Read the switch value&nbsp;
+
| colspan="2" | Allows the LCD backlight brighntess to be adjusted&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | index
+
| width="90%" | Intensity
 
|-
 
|-
| colspan="2" | 0 (left) or 1 (right)&nbsp;
+
| colspan="2" | Range 0-100, 0=Off, 1=Min Brightness, 100=Max Brightness&nbsp;
 
|-
 
|-
| 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''
 
|}
 
|}
  
  
 +
===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;" | '''SampleAccel'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDClear'''
 
|-
 
|-
| colspan="2" | Samples the accelerometer 0 = no new data, 1 = new data available&nbsp;
+
| colspan="2" | Clears the LCD&nbsp;
 
|-
 
|-
 
|-
 
|-
| 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''
 
|}
 
|}
  
  
 +
===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;" | '''Left'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDDrawLine'''
 
|-
 
|-
| colspan="2" | Rotates the robot left - waits for the angle to be traversed before returning&nbsp;
+
| colspan="2" | Allows a single pixel width line to be drawn on the LCD&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Angle
+
| width="90%" | X1
 
|-
 
|-
| colspan="2" | Angle to turn in degrees&nbsp;
+
| colspan="2" | X Pixel 0-127&nbsp;
 
|-
 
|-
| 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" | Y Pixel 0-31&nbsp;
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadIR'''
 
 
|-
 
|-
| colspan="2" | Reads an IR sensor 0=Left, 1=FrontLeft, 2=Front, 3=FrontRight, 4=Right, 5=RearRight,  6=Rear, 7=RearLeft&nbsp;
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | X2
 
|-
 
|-
 +
| colspan="2" | X Pixel 0-127&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | index
+
| width="90%" | Y2
 
|-
 
|-
| colspan="2" | 0=Left, 1=FrontLeft, 2=Front, 3=FrontRight, 4=Right, 5=RearRight, 6=Rear, 7=RearLeft&nbsp;
+
| colspan="2" | Y Pixel 0-31&nbsp;
 
|-
 
|-
| 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''
 
|}
 
|}
  
  
 +
===LCDDrawPixel===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 485: Line 474:
  
  
 +
===LCDDrawRect===
 
{| 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;" | '''ServoSetPosition'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDDrawRect'''
 +
|-
 +
| colspan="2" | Allows a rectangle to be drawn on the LCD&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | X1
 +
|-
 +
| colspan="2" | X Pixel 0-127&nbsp;
 
|-
 
|-
| colspan="2" | Allows one of the servo positions to be assigned&nbsp;
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Y1
 
|-
 
|-
 +
| colspan="2" | Y Pixel 0-31&nbsp;
 
|-
 
|-
 
| 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%" | X2
 
|-
 
|-
| colspan="2" | Range 0-3&nbsp;
+
| colspan="2" | X Pixel 0-127&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Position
+
| width="90%" | Y2
 
|-
 
|-
| colspan="2" | Range 0-255&nbsp;
+
| colspan="2" | Y Pixel 0-31&nbsp;
 
|-
 
|-
 
| 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 508: Line 508:
  
  
 +
===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;" | '''CardBitmap'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDPrintNumber'''
 
|-
 
|-
| colspan="2" | Displays a monochrome bitmap read from the card on the LCD&nbsp;
+
| colspan="2" | Prints a 16-bit signed number to the LCD&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 519: Line 520:
 
| width="90%" | X
 
| width="90%" | X
 
|-
 
|-
| colspan="2" | Range 0-127&nbsp;
+
| colspan="2" | X Pixel 0-127&nbsp;
 
|-
 
|-
 
| 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%" | Y
 
|-
 
|-
| colspan="2" | Range 0-31&nbsp;
+
| colspan="2" | LCD Y coordinate 0-31&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
+
| width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT
| width="90%" | Filename
+
| width="90%" | Number
 
|-
 
|-
| colspan="2" | &nbsp;
+
| colspan="2" | Range -32768 to 32767&nbsp;
 
|-
 
|-
| 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''
 
|}
 
|}
  
  
 +
===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;" | '''CardRecordMic'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDPrintString'''
 
|-
 
|-
| colspan="2" | Records an audio stream on the card from the microphone&nbsp;
+
| colspan="2" | Prints a string to the LCD&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | BitDepth
+
| width="90%" | X
 
|-
 
|-
| colspan="2" | 0=8-bit, 1=16-bit&nbsp;
+
| colspan="2" | X Pixel 0-127&nbsp;
 
|-
 
|-
 
| 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%" | Y
 
|-
 
|-
| colspan="2" | Sample Rate 0=8KHz, 1=16KHz&nbsp;
+
| colspan="2" | LCD Y Coordinate 0-31&nbsp;
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | RecordTime
 
|-
 
| colspan="2" | Time to record for in seconds, Range 0-65535&nbsp;
 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Filename
+
| width="90%" | Data
 
|-
 
|-
 
| colspan="2" | &nbsp;
 
| colspan="2" | &nbsp;
 
|-
 
|-
| 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''
 
|}
 
|}
  
  
 +
===LCDVerbose===
 
{| 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;" | '''CardOpen'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDVerbose'''
 
|-
 
|-
| colspan="2" | Attempts to open an existing file on the SD card 255=Error, 1=File not found, 0=Open OK&nbsp;
+
| colspan="2" | Allows the LCD to automatically report the API commands as they get processed. Default - verbose on&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Filename
+
| width="90%" | State
 
|-
 
|-
| colspan="2" | &nbsp;
+
| colspan="2" | 0=Off 1=On&nbsp;
 
|-
 
|-
| 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''
 
|}
 
|}
  
  
 +
===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;" | '''Forwards'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LEDOff'''
 
|-
 
|-
| colspan="2" | Drives the robot forwards - waits for the distance to be traversed before returning&nbsp;
+
| colspan="2" | Clears a single LED 0-7&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Distance
+
| width="90%" | index
 
|-
 
|-
| colspan="2" | Distance in mm&nbsp;
+
| colspan="2" | Range: 0-7&nbsp;
 
|-
 
|-
 
| 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 605: Line 604:
  
  
 +
===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;" | '''ReadBearing'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LEDOn'''
 +
|-
 +
| colspan="2" | Sets a single LED 0-7&nbsp;
 +
|-
 
|-
 
|-
| colspan="2" | Reads the compass bearing based on the degrees clockwise from magnetic north.&nbsp;
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | index
 
|-
 
|-
 +
| colspan="2" | Range: 0-7&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT
+
| 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''
 
|}
 
|}
  
  
 +
===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;" | '''GetConsoleHandle'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LEDWrite'''
 +
|-
 +
| colspan="2" | Sets the value of the LEDs as an 8-bit output&nbsp;
 +
|-
 
|-
 
|-
| colspan="2" | Gets the handle to the console allowing data displaying on the panel etc.&nbsp;
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Value
 
|-
 
|-
 +
| colspan="2" | LED value 0=All Off, 255 = All On&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-h32-icon.png]] - HANDLE
+
| 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''
 
|}
 
|}
  
  
 +
===Left===
 
{| 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;" | '''Left'''
 +
|-
 +
| colspan="2" | Rotates the robot left - waits for the angle to be traversed before returning&nbsp;
 +
|-
 
|-
 
|-
| colspan="2" | Allows a single pixel width line to be drawn on the LCD&nbsp;
+
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Angle
 
|-
 
|-
 +
| colspan="2" | Angle to turn in degrees&nbsp;
 
|-
 
|-
| 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%" | X1
+
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 
 +
 
 +
===PlayNote===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
| colspan="2" | X Pixel 0-127&nbsp;
+
| 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="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| colspan="2" | Plays a note using the speaker on the FA&nbsp;
| width="90%" | Y1
 
 
|-
 
|-
| colspan="2" | Y Pixel 0-31&nbsp;
 
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | X2
+
| width="90%" | Note
 
|-
 
|-
| colspan="2" | X Pixel 0-127&nbsp;
+
| colspan="2" | Range 1 to 65535 in Hz&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Y2
+
| width="90%" | Delay
 
|-
 
|-
| colspan="2" | Y Pixel 0-31&nbsp;
+
| colspan="2" | Number of milliseconds to play the note for&nbsp;
 
|-
 
|-
 
| 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 664: Line 685:
  
  
 +
===ReadAllSensors===
 
{| 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;" | '''ServoAutoMoveToPosition'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadAllSensors'''
 
|-
 
|-
| colspan="2" | Allows one of the servo positions to move gradually to a new position&nbsp;
+
| colspan="2" | Samples all of the robot's sensors at once, storing the values locally&nbsp;
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Range 0-3&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Position
 
 
|-
 
|-
| colspan="2" | Range 0-255&nbsp;
 
 
|-
 
|-
 
| 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 687: Line 699:
  
  
 +
===ReadAllValue===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 705: Line 718:
  
  
 +
===ReadAxis===
 
{| 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;" | '''ReadAxis'''
 
|-
 
|-
| colspan="2" | Allows the LCD backlight brighntess to be adjusted&nbsp;
+
| colspan="2" | Reads a single X/Y/Z axis from the accelerometer sensor. &nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Intensity
+
| width="90%" | index
 
|-
 
|-
| colspan="2" | Range 0-100, 0=Off, 1=Min Brightness, 100=Max Brightness&nbsp;
+
| colspan="2" | 0=X, 1=Y, 2=Z&nbsp;
 
|-
 
|-
| 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-s16-icon.png]] - INT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===ReadBearing===
 
{| 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;" | '''LCDDrawRect'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadBearing'''
 
|-
 
|-
| colspan="2" | Allows a rectangle to be drawn on the LCD&nbsp;
+
| colspan="2" | Reads the compass bearing based on the degrees clockwise from magnetic north.&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT
| width="90%" | X1
 
|-
 
| colspan="2" | X Pixel 0-127&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Y1
 
|-
 
| colspan="2" | Y Pixel 0-31&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | X2
 
|-
 
| colspan="2" | X Pixel 0-127&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Y2
 
|-
 
| colspan="2" | Y Pixel 0-31&nbsp;
 
|-
 
| 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''
 
|}
 
|}
  
  
 +
===ReadIR===
 
{| 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;" | '''ReadLine'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadIR'''
 
|-
 
|-
| colspan="2" | Reads one of the IR line sensors 0-1 0=Left, 1=Right&nbsp;
+
| colspan="2" | Reads an IR sensor 0=Left, 1=FrontLeft, 2=Front, 3=FrontRight, 4=Right, 5=RearRight,  6=Rear, 7=RearLeft&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 767: Line 763:
 
| width="90%" | index
 
| width="90%" | index
 
|-
 
|-
| colspan="2" | 0=Left, 1=Right&nbsp;
+
| colspan="2" | 0=Left, 1=FrontLeft, 2=Front, 3=FrontRight, 4=Right, 5=RearRight, 6=Rear, 7=RearLeft&nbsp;
 
|-
 
|-
 
| 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-u16-icon.png]] - UINT
Line 774: Line 770:
  
  
 +
===ReadLight===
 
{| 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;" | '''ServoDisable'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadLight'''
 
|-
 
|-
| colspan="2" | Allows one of the servo outputs 0-3 to be disabled&nbsp;
+
| colspan="2" | Reads the light sensor 0-4095 - 4095 = Max Brightness&nbsp;
 
|-
 
|-
 
|-
 
|-
| 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%" | Channel
 
|-
 
| colspan="2" | Range 0-3&nbsp;
 
|-
 
| 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''
 
|}
 
|}
  
  
 +
===ReadLine===
 
{| 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;" | '''ServoEnable'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadLine'''
 
|-
 
|-
| colspan="2" | Allows one of the servo outputs 0-3 to be enabled&nbsp;
+
| colspan="2" | Reads one of the IR line sensors 0-1 0=Left, 1=Right&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| 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%" | index
 
|-
 
|-
| colspan="2" | Range 0-3&nbsp;
+
| colspan="2" | 0=Left, 1=Right&nbsp;
 
|-
 
|-
| 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;" | '''CardReadByte'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadMic'''
 
|-
 
|-
| colspan="2" | Reads a byte from the currently open file. Starts at the beginning of the file and auto increments to the end&nbsp;
+
| colspan="2" | Reads the microphone sensor 0 - 4095&nbsp;
 
|-
 
|-
 
|-
 
|-
| 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-u16-icon.png]] - UINT
 
| 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;" | '''CardErase'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadSwitch'''
 
|-
 
|-
| colspan="2" | Attempts to delete an existing file on the SD card 255=Error, 1=File not found, 0=Delete OK&nbsp;
+
| colspan="2" | Read the switch value&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Filename
+
| width="90%" | index
 
|-
 
|-
| colspan="2" | &nbsp;
+
| colspan="2" | 0 (left) or 1 (right)&nbsp;
 
|-
 
|-
 
| 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-u8-icon.png]] - BYTE
Line 841: Line 836:
  
  
 +
===Right===
 
{| 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;" | '''CardWriteByte'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Right'''
 
|-
 
|-
| colspan="2" | Appends a byte to the end of the currently open file &nbsp;
+
| colspan="2" | Rotates the robot right - waits for the angle to be traversed before returning&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Data
+
| width="90%" | Angle
 
|-
 
|-
| colspan="2" | &nbsp;
+
| colspan="2" | Angle to turn in degrees&nbsp;
 
|-
 
|-
 
| 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 859: Line 855:
  
  
 +
===SampleAccel===
 
{| 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;" | '''EncoderRead'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SampleAccel'''
 +
|-
 +
| colspan="2" | Samples the accelerometer 0 = no new data, 1 = new data available&nbsp;
 +
|-
 
|-
 
|-
| colspan="2" | Reads one of the motor encoder counters. Approx 0.328296mm of travel per encoder unit.&nbsp;
+
| 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''
 +
|}
 +
 
 +
 
 +
===SampleMag===
 +
{| 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;" | '''SampleMag'''
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| colspan="2" | Samples the magnetometer 0 = no new data, 1 = new data available&nbsp;
| width="90%" | index
 
 
|-
 
|-
| colspan="2" | 0=Left, 1=Right&nbsp;
 
 
|-
 
|-
| 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-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===ServoAutoMoveToPosition===
 
{| 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;" | '''ServoAutoMoveToPosition'''
 
|-
 
|-
| colspan="2" | Sets the motor speeds without feedback Range -100 to 100&nbsp;
+
| colspan="2" | Allows one of the servo positions to move gradually to a new position&nbsp;
 
|-
 
|-
 
|-
 
|-
| 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" | Range -100 to 100&nbsp;
+
| colspan="2" | Range 0-3&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Right
+
| width="90%" | Position
 
|-
 
|-
| colspan="2" | Range -100 to 100&nbsp;
+
| colspan="2" | Range 0-255&nbsp;
 
|-
 
|-
 
| 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 900: Line 907:
  
  
 +
===ServoDisable===
 
{| 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;" | '''Backwards'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ServoDisable'''
 
|-
 
|-
| colspan="2" | Drives the robot backwards - waits for the distance to be traversed before returning&nbsp;
+
| colspan="2" | Allows one of the servo outputs 0-3 to be disabled&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Distance
+
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | Distance in mm&nbsp;
+
| colspan="2" | Range 0-3&nbsp;
 
|-
 
|-
 
| 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 918: Line 926:
  
  
 +
===ServoEnable===
 
{| 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;" | '''ServoEnable'''
 +
|-
 +
| colspan="2" | Allows one of the servo outputs 0-3 to be enabled&nbsp;
 +
|-
 
|-
 
|-
| colspan="2" | Resets the motor encoder counters&nbsp;
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 
|-
 
|-
 +
| colspan="2" | Range 0-3&nbsp;
 
|-
 
|-
 
| 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 931: Line 945:
  
  
 +
===ServoSetAutoMoveSpeed===
 
{| 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;" | '''LCDVerbose'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ServoSetAutoMoveSpeed'''
 
|-
 
|-
| colspan="2" | Allows the LCD to automatically report the API commands as they get processed. Default - verbose on&nbsp;
+
| colspan="2" | Changes the speed of the auto movements  Default - 1&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | State
+
| width="90%" | Speed
 
|-
 
|-
| colspan="2" | 0=Off 1=On&nbsp;
+
| colspan="2" | Range 1-50&nbsp;
 
|-
 
|-
 
| 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 949: Line 964:
  
  
 +
===ServoSetPosition===
 
{| 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;" | '''SetProp'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ServoSetPosition'''
 
|-
 
|-
| colspan="2" | Allows the COM port property to be set from a parent component.&nbsp;
+
| colspan="2" | Allows one of the servo positions to be assigned&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | PropName
+
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | &nbsp;
+
| colspan="2" | Range 0-3&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | PropVal
+
| width="90%" | Position
 
|-
 
|-
| colspan="2" | &nbsp;
+
| colspan="2" | Range 0-255&nbsp;
 
|-
 
|-
 
| 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 972: Line 988:
  
  
 +
===SetLogoSpeed===
 
{| 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;" | '''CardInit'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetLogoSpeed'''
 +
|-
 +
| colspan="2" | Sets the speed of logo movements&nbsp;
 +
|-
 
|-
 
|-
| colspan="2" | Attempts to startup the SD card  255=No Card, 254=Init Fail, 0=Init OK&nbsp;
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Speed
 
|-
 
|-
 +
| colspan="2" | Logo Speed 1-100 - Default 40&nbsp;
 
|-
 
|-
| 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''
 
|}
 
|}
  
  
 +
===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;" | '''GetProp'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetMotors'''
 +
|-
 +
| colspan="2" | Sets the motor speeds without feedback Range -100 to 100&nbsp;
 +
|-
 
|-
 
|-
| colspan="2" | Allows the property filter for the COM port list to be copied to a parent component.&nbsp;
+
| width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT
 +
| width="90%" | Left
 
|-
 
|-
 +
| colspan="2" | Range -100 to 100&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
+
| width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT
| width="90%" | PropName
+
| width="90%" | Right
 
|-
 
|-
| colspan="2" | &nbsp;
+
| colspan="2" | Range -100 to 100&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
+
| 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''
 
|}
 
|}
  
  
 +
===SetProp===
 
{| 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;" | '''LCDClear'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetProp'''
 +
|-
 +
| colspan="2" | Allows the COM port property to be set from a parent component.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | PropName
 +
|-
 +
| colspan="2" | &nbsp;
 
|-
 
|-
| colspan="2" | Clears the LCD&nbsp;
+
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
 +
| width="90%" | PropVal
 
|-
 
|-
 +
| colspan="2" | &nbsp;
 
|-
 
|-
 
| 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
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 
 
  
  

Latest revision as of 08:10, 16 January 2024

Author Matrix Ltd
Version 1.2
Category AllCode


Formula AllCode API component

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

Component Source Code

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

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

Detailed description

No detailed description exists yet for this component

Examples

No additional examples

Macro reference

Backwards

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


CardBitmap

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


CardCreate

Fc9-comp-macro.png CardCreate
Attempts to create a file on the SD card 255=Error, 1=File Already Exists, 0=Create OK 
Fc9-string-icon.png - STRING Filename
 
Fc9-u8-icon.png - BYTE Return


CardErase

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


CardInit

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


CardOpen

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


CardPlayback

Fc9-comp-macro.png CardPlayback
Plays back a .Wav file audio stream from the card 
Fc9-string-icon.png - STRING Filename
 
Fc9-u8-icon.png - BYTE Return


CardReadByte

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


CardRecordMic

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


CardWriteByte

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


EncoderRead

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


EncoderReset

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


Forwards

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


GetConsoleHandle

Fc9-comp-macro.png GetConsoleHandle
Gets the handle to the console allowing data displaying on the panel etc. 
Fc9-h32-icon.png - HANDLE Return


GetProp

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


LCDBacklight

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


LCDClear

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


LCDDrawLine

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


LCDDrawPixel

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


LCDDrawRect

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


LCDPrintNumber

Fc9-comp-macro.png LCDPrintNumber
Prints a 16-bit signed number to the LCD 
Fc9-u8-icon.png - BYTE X
X Pixel 0-127 
Fc9-u8-icon.png - BYTE Y
LCD Y coordinate 0-31 
Fc9-s16-icon.png - INT Number
Range -32768 to 32767 
Fc9-void-icon.png - VOID Return


LCDPrintString

Fc9-comp-macro.png LCDPrintString
Prints a string to the LCD 
Fc9-u8-icon.png - BYTE X
X Pixel 0-127 
Fc9-u8-icon.png - BYTE Y
LCD Y Coordinate 0-31 
Fc9-string-icon.png - STRING Data
 
Fc9-void-icon.png - VOID Return


LCDVerbose

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


LEDOff

Fc9-comp-macro.png LEDOff
Clears a single LED 0-7 
Fc9-u8-icon.png - BYTE index
Range: 0-7 
Fc9-void-icon.png - VOID Return


LEDOn

Fc9-comp-macro.png LEDOn
Sets a single LED 0-7 
Fc9-u8-icon.png - BYTE index
Range: 0-7 
Fc9-void-icon.png - VOID Return


LEDWrite

Fc9-comp-macro.png LEDWrite
Sets the value of the LEDs as an 8-bit output 
Fc9-u8-icon.png - BYTE Value
LED value 0=All Off, 255 = All On 
Fc9-void-icon.png - VOID Return


Left

Fc9-comp-macro.png Left
Rotates the robot left - waits for the angle to be traversed before returning 
Fc9-u16-icon.png - UINT Angle
Angle to turn in degrees 
Fc9-void-icon.png - VOID Return


PlayNote

Fc9-comp-macro.png PlayNote
Plays a note using the speaker on the FA 
Fc9-u16-icon.png - UINT Note
Range 1 to 65535 in Hz 
Fc9-u16-icon.png - UINT Delay
Number of milliseconds to play the note for 
Fc9-void-icon.png - VOID Return


ReadAllSensors

Fc9-comp-macro.png ReadAllSensors
Samples all of the robot's sensors at once, storing the values locally 
Fc9-void-icon.png - VOID Return


ReadAllValue

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


ReadAxis

Fc9-comp-macro.png ReadAxis
Reads a single X/Y/Z axis from the accelerometer sensor.  
Fc9-u8-icon.png - BYTE index
0=X, 1=Y, 2=Z 
Fc9-s16-icon.png - INT Return


ReadBearing

Fc9-comp-macro.png ReadBearing
Reads the compass bearing based on the degrees clockwise from magnetic north. 
Fc9-s16-icon.png - INT Return


ReadIR

Fc9-comp-macro.png ReadIR
Reads an IR sensor 0=Left, 1=FrontLeft, 2=Front, 3=FrontRight, 4=Right, 5=RearRight, 6=Rear, 7=RearLeft 
Fc9-u8-icon.png - BYTE index
0=Left, 1=FrontLeft, 2=Front, 3=FrontRight, 4=Right, 5=RearRight, 6=Rear, 7=RearLeft 
Fc9-u16-icon.png - UINT Return


ReadLight

Fc9-comp-macro.png ReadLight
Reads the light sensor 0-4095 - 4095 = Max Brightness 
Fc9-u16-icon.png - UINT Return


ReadLine

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


ReadMic

Fc9-comp-macro.png ReadMic
Reads the microphone sensor 0 - 4095 
Fc9-u16-icon.png - UINT Return


ReadSwitch

Fc9-comp-macro.png ReadSwitch
Read the switch value 
Fc9-u8-icon.png - BYTE index
0 (left) or 1 (right) 
Fc9-u8-icon.png - BYTE Return


Right

Fc9-comp-macro.png Right
Rotates the robot right - waits for the angle to be traversed before returning 
Fc9-u16-icon.png - UINT Angle
Angle to turn in degrees 
Fc9-void-icon.png - VOID Return


SampleAccel

Fc9-comp-macro.png SampleAccel
Samples the accelerometer 0 = no new data, 1 = new data available 
Fc9-u8-icon.png - BYTE Return


SampleMag

Fc9-comp-macro.png SampleMag
Samples the magnetometer 0 = no new data, 1 = new data available 
Fc9-u8-icon.png - BYTE Return


ServoAutoMoveToPosition

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


ServoDisable

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


ServoEnable

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


ServoSetAutoMoveSpeed

Fc9-comp-macro.png ServoSetAutoMoveSpeed
Changes the speed of the auto movements Default - 1 
Fc9-u8-icon.png - BYTE Speed
Range 1-50 
Fc9-void-icon.png - VOID Return


ServoSetPosition

Fc9-comp-macro.png ServoSetPosition
Allows one of the servo positions to be assigned 
Fc9-u8-icon.png - BYTE Channel
Range 0-3 
Fc9-u8-icon.png - BYTE Position
Range 0-255 
Fc9-void-icon.png - VOID Return


SetLogoSpeed

Fc9-comp-macro.png SetLogoSpeed
Sets the speed of logo movements 
Fc9-u8-icon.png - BYTE Speed
Logo Speed 1-100 - Default 40 
Fc9-void-icon.png - VOID Return


SetMotors

Fc9-comp-macro.png SetMotors
Sets the motor speeds without feedback Range -100 to 100 
Fc9-s16-icon.png - INT Left
Range -100 to 100 
Fc9-s16-icon.png - INT Right
Range -100 to 100 
Fc9-void-icon.png - VOID Return


SetProp

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


Property reference

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