Component: Formula AllCode API (AllCode): Difference between revisions
Appearance
m Text replacement - "width="10%" align="center" style="background-color:#D8C9D8;" align="center"" to "width="10%" align="center" class="mtx-class-macrohead"" |
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead"" |
||
| (One intermediate revision by the same user not shown) | |||
| Line 86: | Line 86: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Backwards''' | ||
|- | |- | ||
| colspan="2" | Drives the robot backwards - waits for the distance to be traversed before returning | | colspan="2" | Drives the robot backwards - waits for the distance to be traversed before returning | ||
| Line 105: | Line 105: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''CardBitmap''' | ||
|- | |- | ||
| colspan="2" | Displays a monochrome bitmap read from the card on the LCD | | colspan="2" | Displays a monochrome bitmap read from the card on the LCD | ||
| Line 134: | Line 134: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''CardCreate''' | ||
|- | |- | ||
| colspan="2" | Attempts to create a file on the SD card 255=Error, 1=File Already Exists, 0=Create OK | | colspan="2" | Attempts to create a file on the SD card 255=Error, 1=File Already Exists, 0=Create OK | ||
| Line 153: | Line 153: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''CardErase''' | ||
|- | |- | ||
| colspan="2" | Attempts to delete an existing file on the SD card 255=Error, 1=File not found, 0=Delete OK | | colspan="2" | Attempts to delete an existing file on the SD card 255=Error, 1=File not found, 0=Delete OK | ||
| Line 172: | Line 172: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''CardInit''' | ||
|- | |- | ||
| colspan="2" | Attempts to startup the SD card 255=No Card, 254=Init Fail, 0=Init OK | | colspan="2" | Attempts to startup the SD card 255=No Card, 254=Init Fail, 0=Init OK | ||
| Line 186: | Line 186: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''CardOpen''' | ||
|- | |- | ||
| colspan="2" | Attempts to open an existing file on the SD card 255=Error, 1=File not found, 0=Open OK | | colspan="2" | Attempts to open an existing file on the SD card 255=Error, 1=File not found, 0=Open OK | ||
| Line 205: | Line 205: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''CardPlayback''' | ||
|- | |- | ||
| colspan="2" | Plays back a .Wav file audio stream from the card | | colspan="2" | Plays back a .Wav file audio stream from the card | ||
| Line 224: | Line 224: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''CardReadByte''' | ||
|- | |- | ||
| colspan="2" | Reads a byte from the currently open file. Starts at the beginning of the file and auto increments to the end | | colspan="2" | Reads a byte from the currently open file. Starts at the beginning of the file and auto increments to the end | ||
| Line 238: | Line 238: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''CardRecordMic''' | ||
|- | |- | ||
| colspan="2" | Records an audio stream on the card from the microphone | | colspan="2" | Records an audio stream on the card from the microphone | ||
| Line 272: | Line 272: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''CardWriteByte''' | ||
|- | |- | ||
| colspan="2" | Appends a byte to the end of the currently open file | | colspan="2" | Appends a byte to the end of the currently open file | ||
| Line 291: | Line 291: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''EncoderRead''' | ||
|- | |- | ||
| colspan="2" | Reads one of the motor encoder counters. Approx 0.328296mm of travel per encoder unit. | | colspan="2" | Reads one of the motor encoder counters. Approx 0.328296mm of travel per encoder unit. | ||
| Line 310: | Line 310: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''EncoderReset''' | ||
|- | |- | ||
| colspan="2" | Resets the motor encoder counters | | colspan="2" | Resets the motor encoder counters | ||
| Line 324: | Line 324: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Forwards''' | ||
|- | |- | ||
| colspan="2" | Drives the robot forwards - waits for the distance to be traversed before returning | | colspan="2" | Drives the robot forwards - waits for the distance to be traversed before returning | ||
| Line 343: | Line 343: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetConsoleHandle''' | ||
|- | |- | ||
| colspan="2" | Gets the handle to the console allowing data displaying on the panel etc. | | colspan="2" | Gets the handle to the console allowing data displaying on the panel etc. | ||
| Line 357: | Line 357: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetProp''' | ||
|- | |- | ||
| colspan="2" | Allows the property filter for the COM port list to be copied to a parent component. | | colspan="2" | Allows the property filter for the COM port list to be copied to a parent component. | ||
| Line 376: | Line 376: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''LCDBacklight''' | ||
|- | |- | ||
| colspan="2" | Allows the LCD backlight brighntess to be adjusted | | colspan="2" | Allows the LCD backlight brighntess to be adjusted | ||
| Line 395: | Line 395: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''LCDClear''' | ||
|- | |- | ||
| colspan="2" | Clears the LCD | | colspan="2" | Clears the LCD | ||
| Line 409: | Line 409: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''LCDDrawLine''' | ||
|- | |- | ||
| colspan="2" | Allows a single pixel width line to be drawn on the LCD | | colspan="2" | Allows a single pixel width line to be drawn on the LCD | ||
| Line 443: | Line 443: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''LCDDrawPixel''' | ||
|- | |- | ||
| colspan="2" | Allows a single pixel on the LCD to be set or cleared | | colspan="2" | Allows a single pixel on the LCD to be set or cleared | ||
| Line 472: | Line 472: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''LCDDrawRect''' | ||
|- | |- | ||
| colspan="2" | Allows a rectangle to be drawn on the LCD | | colspan="2" | Allows a rectangle to be drawn on the LCD | ||
| Line 506: | Line 506: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''LCDPrintNumber''' | ||
|- | |- | ||
| colspan="2" | Prints a 16-bit signed number to the LCD | | colspan="2" | Prints a 16-bit signed number to the LCD | ||
| Line 535: | Line 535: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''LCDPrintString''' | ||
|- | |- | ||
| colspan="2" | Prints a string to the LCD | | colspan="2" | Prints a string to the LCD | ||
| Line 564: | Line 564: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''LCDVerbose''' | ||
|- | |- | ||
| colspan="2" | Allows the LCD to automatically report the API commands as they get processed. Default - verbose on | | colspan="2" | Allows the LCD to automatically report the API commands as they get processed. Default - verbose on | ||
| Line 583: | Line 583: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''LEDOff''' | ||
|- | |- | ||
| colspan="2" | Clears a single LED 0-7 | | colspan="2" | Clears a single LED 0-7 | ||
| Line 602: | Line 602: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''LEDOn''' | ||
|- | |- | ||
| colspan="2" | Sets a single LED 0-7 | | colspan="2" | Sets a single LED 0-7 | ||
| Line 621: | Line 621: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''LEDWrite''' | ||
|- | |- | ||
| colspan="2" | Sets the value of the LEDs as an 8-bit output | | colspan="2" | Sets the value of the LEDs as an 8-bit output | ||
| Line 640: | Line 640: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Left''' | ||
|- | |- | ||
| colspan="2" | Rotates the robot left - waits for the angle to be traversed before returning | | colspan="2" | Rotates the robot left - waits for the angle to be traversed before returning | ||
| Line 659: | Line 659: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''PlayNote''' | ||
|- | |- | ||
| colspan="2" | Plays a note using the speaker on the FA | | colspan="2" | Plays a note using the speaker on the FA | ||
| Line 683: | Line 683: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadAllSensors''' | ||
|- | |- | ||
| colspan="2" | Samples all of the robot's sensors at once, storing the values locally | | colspan="2" | Samples all of the robot's sensors at once, storing the values locally | ||
| Line 697: | Line 697: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadAllValue''' | ||
|- | |- | ||
| colspan="2" | Reads a single value stored from the read all command Index dictates which sensor value to read | | colspan="2" | Reads a single value stored from the read all command Index dictates which sensor value to read | ||
| Line 716: | Line 716: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadAxis''' | ||
|- | |- | ||
| colspan="2" | Reads a single X/Y/Z axis from the accelerometer sensor. | | colspan="2" | Reads a single X/Y/Z axis from the accelerometer sensor. | ||
| Line 735: | Line 735: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadBearing''' | ||
|- | |- | ||
| colspan="2" | Reads the compass bearing based on the degrees clockwise from magnetic north. | | colspan="2" | Reads the compass bearing based on the degrees clockwise from magnetic north. | ||
| Line 749: | Line 749: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadIR''' | ||
|- | |- | ||
| colspan="2" | Reads an IR sensor 0=Left, 1=FrontLeft, 2=Front, 3=FrontRight, 4=Right, 5=RearRight, 6=Rear, 7=RearLeft | | colspan="2" | Reads an IR sensor 0=Left, 1=FrontLeft, 2=Front, 3=FrontRight, 4=Right, 5=RearRight, 6=Rear, 7=RearLeft | ||
| Line 768: | Line 768: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadLight''' | ||
|- | |- | ||
| colspan="2" | Reads the light sensor 0-4095 - 4095 = Max Brightness | | colspan="2" | Reads the light sensor 0-4095 - 4095 = Max Brightness | ||
| Line 782: | Line 782: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadLine''' | ||
|- | |- | ||
| colspan="2" | Reads one of the IR line sensors 0-1 0=Left, 1=Right | | colspan="2" | Reads one of the IR line sensors 0-1 0=Left, 1=Right | ||
| Line 801: | Line 801: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadMic''' | ||
|- | |- | ||
| colspan="2" | Reads the microphone sensor 0 - 4095 | | colspan="2" | Reads the microphone sensor 0 - 4095 | ||
| Line 815: | Line 815: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadSwitch''' | ||
|- | |- | ||
| colspan="2" | Read the switch value | | colspan="2" | Read the switch value | ||
| Line 834: | Line 834: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Right''' | ||
|- | |- | ||
| colspan="2" | Rotates the robot right - waits for the angle to be traversed before returning | | colspan="2" | Rotates the robot right - waits for the angle to be traversed before returning | ||
| Line 853: | Line 853: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SampleAccel''' | ||
|- | |- | ||
| colspan="2" | Samples the accelerometer 0 = no new data, 1 = new data available | | colspan="2" | Samples the accelerometer 0 = no new data, 1 = new data available | ||
| Line 867: | Line 867: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SampleMag''' | ||
|- | |- | ||
| colspan="2" | Samples the magnetometer 0 = no new data, 1 = new data available | | colspan="2" | Samples the magnetometer 0 = no new data, 1 = new data available | ||
| Line 881: | Line 881: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ServoAutoMoveToPosition''' | ||
|- | |- | ||
| colspan="2" | Allows one of the servo positions to move gradually to a new position | | colspan="2" | Allows one of the servo positions to move gradually to a new position | ||
| Line 905: | Line 905: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ServoDisable''' | ||
|- | |- | ||
| colspan="2" | Allows one of the servo outputs 0-3 to be disabled | | colspan="2" | Allows one of the servo outputs 0-3 to be disabled | ||
| Line 924: | Line 924: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ServoEnable''' | ||
|- | |- | ||
| colspan="2" | Allows one of the servo outputs 0-3 to be enabled | | colspan="2" | Allows one of the servo outputs 0-3 to be enabled | ||
| Line 943: | Line 943: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ServoSetAutoMoveSpeed''' | ||
|- | |- | ||
| colspan="2" | Changes the speed of the auto movements Default - 1 | | colspan="2" | Changes the speed of the auto movements Default - 1 | ||
| Line 962: | Line 962: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ServoSetPosition''' | ||
|- | |- | ||
| colspan="2" | Allows one of the servo positions to be assigned | | colspan="2" | Allows one of the servo positions to be assigned | ||
| Line 986: | Line 986: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SetLogoSpeed''' | ||
|- | |- | ||
| colspan="2" | Sets the speed of logo movements | | colspan="2" | Sets the speed of logo movements | ||
| Line 1,005: | Line 1,005: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SetMotors''' | ||
|- | |- | ||
| colspan="2" | Sets the motor speeds without feedback Range -100 to 100 | | colspan="2" | Sets the motor speeds without feedback Range -100 to 100 | ||
| Line 1,029: | Line 1,029: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SetProp''' | ||
|- | |- | ||
| colspan="2" | Allows the COM port property to be set from a parent component. | | colspan="2" | Allows the COM port property to be set from a parent component. | ||
| Line 1,053: | Line 1,053: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Properties''' | ||
|- | |- | ||
|- | |- | ||
Latest revision as of 14:22, 13 July 2026
| Author | Matrix Ltd |
| Version | 1.2 |
| Category | AllCode |
Formula AllCode API component
A simulation only component to allow the Formula AllCode robot to be controlled via it's API interface and Bluetooth data connection without having to compile or re-program the robot.
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
Backwards
| Backwards | |
| Drives the robot backwards - waits for the distance to be traversed before returning | |
| Distance | |
| Distance in mm | |
| Return | |
CardBitmap
| CardBitmap | |
| Displays a monochrome bitmap read from the card on the LCD | |
| X | |
| Range 0-127 | |
| Y | |
| Range 0-31 | |
| Filename | |
| Return | |
CardCreate
| CardCreate | |
| Attempts to create a file on the SD card 255=Error, 1=File Already Exists, 0=Create OK | |
| Filename | |
| Return | |
CardErase
| CardErase | |
| Attempts to delete an existing file on the SD card 255=Error, 1=File not found, 0=Delete OK | |
| Filename | |
| Return | |
CardInit
| CardInit | |
| Attempts to startup the SD card 255=No Card, 254=Init Fail, 0=Init OK | |
| Return | |
CardOpen
| CardOpen | |
| Attempts to open an existing file on the SD card 255=Error, 1=File not found, 0=Open OK | |
| Filename | |
| Return | |
CardPlayback
| CardPlayback | |
| Plays back a .Wav file audio stream from the card | |
| Filename | |
| Return | |
CardReadByte
| CardReadByte | |
| Reads a byte from the currently open file. Starts at the beginning of the file and auto increments to the end | |
| Return | |
CardRecordMic
CardWriteByte
| CardWriteByte | |
| Appends a byte to the end of the currently open file | |
| Data | |
| Return | |
EncoderRead
| EncoderRead | |
| Reads one of the motor encoder counters. Approx 0.328296mm of travel per encoder unit. | |
| index | |
| 0=Left, 1=Right | |
| Return | |
EncoderReset
| EncoderReset | |
| Resets the motor encoder counters | |
| Return | |
Forwards
| Forwards | |
| Drives the robot forwards - waits for the distance to be traversed before returning | |
| Distance | |
| Distance in mm | |
| Return | |
GetConsoleHandle
| GetConsoleHandle | |
| Gets the handle to the console allowing data displaying on the panel etc. | |
| Return | |
GetProp
| GetProp | |
| Allows the property filter for the COM port list to be copied to a parent component. | |
| PropName | |
| Return | |
LCDBacklight
| LCDBacklight | |
| Allows the LCD backlight brighntess to be adjusted | |
| Intensity | |
| Range 0-100, 0=Off, 1=Min Brightness, 100=Max Brightness | |
| Return | |
LCDClear
| LCDClear | |
| Clears the LCD | |
| Return | |
LCDDrawLine
| LCDDrawLine | |
| Allows a single pixel width line to be drawn on the LCD | |
| X1 | |
| X Pixel 0-127 | |
| Y1 | |
| Y Pixel 0-31 | |
| X2 | |
| X Pixel 0-127 | |
| Y2 | |
| Y Pixel 0-31 | |
| Return | |
LCDDrawPixel
| LCDDrawPixel | |
| Allows a single pixel on the LCD to be set or cleared | |
| X | |
| X Pixel 0-127 | |
| Y | |
| Y Pixel 0-31 | |
| State | |
| 0=White (Off), 1=Black (On) | |
| Return | |
LCDDrawRect
| LCDDrawRect | |
| Allows a rectangle to be drawn on the LCD | |
| X1 | |
| X Pixel 0-127 | |
| Y1 | |
| Y Pixel 0-31 | |
| X2 | |
| X Pixel 0-127 | |
| Y2 | |
| Y Pixel 0-31 | |
| Return | |
LCDPrintNumber
| LCDPrintNumber | |
| Prints a 16-bit signed number to the LCD | |
| X | |
| X Pixel 0-127 | |
| Y | |
| LCD Y coordinate 0-31 | |
| Number | |
| Range -32768 to 32767 | |
| Return | |
LCDPrintString
| LCDPrintString | |
| Prints a string to the LCD | |
| X | |
| X Pixel 0-127 | |
| Y | |
| LCD Y Coordinate 0-31 | |
| Data | |
| Return | |
LCDVerbose
| LCDVerbose | |
| Allows the LCD to automatically report the API commands as they get processed. Default - verbose on | |
| State | |
| 0=Off 1=On | |
| Return | |
LEDOff
| LEDOff | |
| Clears a single LED 0-7 | |
| index | |
| Range: 0-7 | |
| Return | |
LEDOn
| LEDOn | |
| Sets a single LED 0-7 | |
| index | |
| Range: 0-7 | |
| Return | |
LEDWrite
| LEDWrite | |
| Sets the value of the LEDs as an 8-bit output | |
| Value | |
| LED value 0=All Off, 255 = All On | |
| Return | |
Left
| Left | |
| Rotates the robot left - waits for the angle to be traversed before returning | |
| Angle | |
| Angle to turn in degrees | |
| Return | |
PlayNote
| PlayNote | |
| Plays a note using the speaker on the FA | |
| Note | |
| Range 1 to 65535 in Hz | |
| Delay | |
| Number of milliseconds to play the note for | |
| Return | |
ReadAllSensors
| ReadAllSensors | |
| Samples all of the robot's sensors at once, storing the values locally | |
| Return | |
ReadAllValue
| ReadAllValue | |
| Reads a single value stored from the read all command Index dictates which sensor value to read | |
| Index | |
| 0=SW, 1-8=IR, 9-10=Line, 11=Light, 12=Mic, 13-15=Accel | |
| Return | |
ReadAxis
| ReadAxis | |
| Reads a single X/Y/Z axis from the accelerometer sensor. | |
| index | |
| 0=X, 1=Y, 2=Z | |
| Return | |
ReadBearing
| ReadBearing | |
| Reads the compass bearing based on the degrees clockwise from magnetic north. | |
| Return | |
ReadIR
ReadLight
| ReadLight | |
| Reads the light sensor 0-4095 - 4095 = Max Brightness | |
| Return | |
ReadLine
| ReadLine | |
| Reads one of the IR line sensors 0-1 0=Left, 1=Right | |
| index | |
| 0=Left, 1=Right | |
| Return | |
ReadMic
| ReadMic | |
| Reads the microphone sensor 0 - 4095 | |
| Return | |
ReadSwitch
| ReadSwitch | |
| Read the switch value | |
| index | |
| 0 (left) or 1 (right) | |
| Return | |
Right
| Right | |
| Rotates the robot right - waits for the angle to be traversed before returning | |
| Angle | |
| Angle to turn in degrees | |
| Return | |
SampleAccel
| SampleAccel | |
| Samples the accelerometer 0 = no new data, 1 = new data available | |
| Return | |
SampleMag
| SampleMag | |
| Samples the magnetometer 0 = no new data, 1 = new data available | |
| Return | |
ServoAutoMoveToPosition
| ServoAutoMoveToPosition | |
| Allows one of the servo positions to move gradually to a new position | |
| Channel | |
| Range 0-3 | |
| Position | |
| Range 0-255 | |
| Return | |
ServoDisable
| ServoDisable | |
| Allows one of the servo outputs 0-3 to be disabled | |
| Channel | |
| Range 0-3 | |
| Return | |
ServoEnable
| ServoEnable | |
| Allows one of the servo outputs 0-3 to be enabled | |
| Channel | |
| Range 0-3 | |
| Return | |
ServoSetAutoMoveSpeed
| ServoSetAutoMoveSpeed | |
| Changes the speed of the auto movements Default - 1 | |
| Speed | |
| Range 1-50 | |
| Return | |
ServoSetPosition
| ServoSetPosition | |
| Allows one of the servo positions to be assigned | |
| Channel | |
| Range 0-3 | |
| Position | |
| Range 0-255 | |
| Return | |
SetLogoSpeed
| SetLogoSpeed | |
| Sets the speed of logo movements | |
| Speed | |
| Logo Speed 1-100 - Default 40 | |
| Return | |
SetMotors
| SetMotors | |
| Sets the motor speeds without feedback Range -100 to 100 | |
| Left | |
| Range -100 to 100 | |
| Right | |
| Range -100 to 100 | |
| Return | |
SetProp
| SetProp | |
| Allows the COM port property to be set from a parent component. | |
| PropName | |
| PropVal | |
| Return | |
Property reference
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