Difference between revisions of "Component: API (Arduino Mega) (API Slave Devices)"
From Flowcode Help
Jump to navigationJump to search (Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix TSL |- | width="20%" style="color:gray;" | Version | 2.0 |- | width="20%" style="color:gray...") |
|||
| Line 20: | Line 20: | ||
==Detailed description== | ==Detailed description== | ||
| + | |||
| + | |||
''No detailed description exists yet for this component'' | ''No detailed description exists yet for this component'' | ||
==Examples== | ==Examples== | ||
| + | |||
| + | |||
''<span style="color:red;">No additional examples</span>'' | ''<span style="color:red;">No additional examples</span>'' | ||
| − | == | + | ==Macro reference== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
Revision as of 14:09, 20 January 2023
| Author | Matrix TSL |
| Version | 2.0 |
| Category | API Slave Devices |
Contents
API (Arduino Mega) component
Connects to an Arduino Mega running the API Firmware allowing the board to become a slave to the Flowcode Embedded simulation or Flowcode App Developer. Supports: Digital IO / ADC / I2C / SPI / UART / PWM See Flowcode Help Wiki for firmware.
Component Source Code
Please click here for the component source code: FC_Comp_Source_Arduino_Mega_API_Comp.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
| I2CInitialise | |
| Initialsie the I2C module ready for communications | |
| Channel | |
| Channel Index: Range 0 - I2C Bus Count - 1 | |
| Baud | |
| 0=100KHz, 1=400KHz, 2=1MHz | |
| Return | |
| IOGetInputPin | |
| Sets the selected digital pin to an input and reads the input state. | |
| Pin | |
| Range: 0-53 | |
| Return | |
| ADCSample8 | |
| Reads the voltage present on an Analog pin as an 8-bit value range 0-255 | |
| ADCChannel | |
| Range: 0-15 | |
| Return | |
| UARTCheckRX | |
| Check to see if the UART module has received any data | |
| Channel | |
| Channel Index: Range 0 - UART Bus Count - 1 | |
| Return | |
| UARTInitialise | |
| Initialise the UART module ready for communications | |
| Channel | |
| Channel Index: Range 0 - UART Bus Count - 1 | |
| Return | |
| RegisterWrite | |
| Writes to one of the registers on-board the device | |
| RegisterAddress | |
| The address of the register | |
| Data | |
| The data value to assign to the register | |
| Return | |
| RegisterRead | |
| Read one of the registers on-board the device | |
| RegisterAddress | |
| The address of the register | |
| Return | |
| I2CRestart | |
| Put the I2C Module into Restart mode | |
| Channel | |
| Channel Index: Range 0 - I2C Bus Count - 1 | |
| Return | |
| PWMDisable | |
| Disable a PWM output | |
| Channel | |
| Range: 0-15 | |
| Return | |
| I2CStart | |
| Put the I2C Module into Start mode | |
| Channel | |
| Channel Index: Range 0 - I2C Bus Count - 1 | |
| Return | |
| SPITransfer | |
| Transfer a byte using the SPI bus | |
| Channel | |
| Channel Index: Range 0 - SPI Bus Count - 1 | |
| DataOut | |
| Return | |
| I2CReceive | |
| Receive a byte using the I2C bus | |
| Channel | |
| Channel Index: Range 0 - I2C Bus Count - 1 | |
| Last | |
| Last byte to receive: Range 0-1 | |
| Return | |
| I2CStop | |
| Put the I2C Module into Stop mode | |
| Channel | |
| Return | |
| ADCSetReferenceVoltage | |
| Specified the reference setting for ADC reads. | |
| RefType | |
| 0=AREF, 1=VCC, 3=Internal 1.1V | |
| Return | |
| SPIPrescaler | |
| Modify the speed of the SPI bus | |
| Channel | |
| Channel Index: Range 0 - SPI Bus Count - 1 | |
| Prescaler | |
| Range: 0-2 | |
| Return | |
| PWMSetDuty | |
| Sets the duty for the PWM output | |
| Channel | |
| Range: 0-15 | |
| Duty | |
| Return | |
| ADCSample10 | |
| Reads the voltage present on an Analog pin as an 10-bit value range 0-1023 | |
| ADCChannel | |
| Range: 0-15 | |
| Return | |
| IOSetOutputPin | |
| Sets the selected digital pin to an output and assigns the output state. | |
| Pin | |
| Range: 0-53 | |
| State | |
| Range: 0-1 | |
| Return | |
| UARTReceive | |
| Receives a data byte from the UART. Recommend calling the UARTCheckRx function first to ensure data is available. | |
| Channel | |
| Channel Index: Range 0 - UART Bus Count - 1 | |
| Return | |
| SPIInitialise | |
| Initialsie the SPI module ready for communications | |
| Channel | |
| Channel Index: Range 0 - SPI Bus Count - 1 | |
| Return | |
| I2CSend | |
| Transmit a byte using the I2C bus | |
| Channel | |
| Channel Index: Range 0 - I2C Bus Count - 1 | |
| DataOut | |
| Return | |
| UARTSend | |
| Send a byte via the UART module | |
| Channel | |
| Channel Index: Range 0 - UART Bus Count - 1 | |
| Data | |
| Data Byte to send. Range: 0-255 | |
| Return | |
| PWMSetPrescaler | |
| Sets the prescaler for the PWM output | |
| Channel | |
| Range: 0-15 | |
| Prescaler | |
| Period | |
| Default 255 | |
| Return | |
| PWMEnable | |
| Enable a PWM output | |
| Channel | |
| Range: 0-15 | |
| Return | |
| Initialise | |
| Initialise the comms to the Arduino board ready for commands to be sent. | |
| Return | |