Component: API (Arduino Mega) (API Slave Devices)
From Flowcode Help
Jump to navigationJump to search| Author | Matrix TSL |
| Version | 2.0 |
| Category | API Slave Devices |
Contents
- 1 API (Arduino Mega) component
- 2 Component Source Code
- 3 Detailed description
- 4 Examples
- 5 Macro reference
- 5.1 I2CInitialise
- 5.2 ADCSampleArray8
- 5.3 SPITransferTrans
- 5.4 IOGetInputPin
- 5.5 UARTBaud
- 5.6 ADCSample8
- 5.7 I2CTransReceive
- 5.8 UARTCheckRX
- 5.9 UARTInitialise
- 5.10 RegisterWrite
- 5.11 ADCSetPrechargeTime
- 5.12 RegisterRead
- 5.13 I2CRestart
- 5.14 PWMDisable
- 5.15 I2CStart
- 5.16 SPITransfer
- 5.17 I2CReceive
- 5.18 I2CStop
- 5.19 ADCSetReferenceVoltage
- 5.20 SPIPrescaler
- 5.21 PWMSetDuty
- 5.22 ADCSample10
- 5.23 I2CTransSend
- 5.24 IOSetOutputPin
- 5.25 UARTReceive
- 5.26 ADCSampleAverage10
- 5.27 I2CTransInit
- 5.28 SPIInitialise
- 5.29 I2CSend
- 5.30 UARTSend
- 5.31 PWMSetPrescaler
- 5.32 PWMEnable
- 5.33 ADCSampleArray10
- 5.34 ADCSampleAverage8
- 5.35 Initialise
- 6 Property reference
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 to download the component source project: FC_Comp_Source_Arduino_Mega_API_Comp.fcfx
Please click here to view the component source code (Beta): 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
| 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 | |
ADCSampleArray8
SPITransferTrans
IOGetInputPin
| IOGetInputPin | |
| Sets the selected digital pin to an input and reads the input state. | |
| Pin | |
| Range: 0-53 | |
| Return | |
UARTBaud
ADCSample8
| ADCSample8 | |
| Reads the voltage present on an Analog pin as an 8-bit value range 0-255 | |
| ADCChannel | |
| Range: 0-15 | |
| Return | |
I2CTransReceive
UARTCheckRX
| UARTCheckRX | |
| Check to see if the UART module has received any data | |
| Channel | |
| Channel Index: Range 0 - UART Bus Count - 1 | |
| Return | |
UARTInitialise
| UARTInitialise | |
| Initialise the UART module ready for communications | |
| Channel | |
| Channel Index: Range 0 - UART Bus Count - 1 | |
| Return | |
RegisterWrite
| 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 | |
ADCSetPrechargeTime
RegisterRead
| RegisterRead | |
| Read one of the registers on-board the device | |
| RegisterAddress | |
| The address of the register | |
| Return | |
I2CRestart
| I2CRestart | |
| Put the I2C Module into Restart mode | |
| Channel | |
| Channel Index: Range 0 - I2C Bus Count - 1 | |
| Return | |
PWMDisable
| PWMDisable | |
| Disable a PWM output | |
| Channel | |
| Range: 0-15 | |
| Return | |
I2CStart
| I2CStart | |
| Put the I2C Module into Start mode | |
| Channel | |
| Channel Index: Range 0 - I2C Bus Count - 1 | |
| Return | |
SPITransfer
| SPITransfer | |
| Transfer a byte using the SPI bus | |
| Channel | |
| Channel Index: Range 0 - SPI Bus Count - 1 | |
| DataOut | |
| Return | |
I2CReceive
| 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
| I2CStop | |
| Put the I2C Module into Stop mode | |
| Channel | |
| Return | |
ADCSetReferenceVoltage
| ADCSetReferenceVoltage | |
| Specified the reference setting for ADC reads. | |
| RefType | |
| 0=AREF, 1=VCC, 3=Internal 1.1V | |
| Return | |
SPIPrescaler
| SPIPrescaler | |
| Modify the speed of the SPI bus | |
| Channel | |
| Channel Index: Range 0 - SPI Bus Count - 1 | |
| Prescaler | |
| Range: 0-2 | |
| Return | |
PWMSetDuty
| PWMSetDuty | |
| Sets the duty for the PWM output | |
| Channel | |
| Range: 0-15 | |
| Duty | |
| Return | |
ADCSample10
| ADCSample10 | |
| Reads the voltage present on an Analog pin as an 10-bit value range 0-1023 | |
| ADCChannel | |
| Range: 0-15 | |
| Return | |
I2CTransSend
IOSetOutputPin
| IOSetOutputPin | |
| Sets the selected digital pin to an output and assigns the output state. | |
| Pin | |
| Range: 0-53 | |
| State | |
| Range: 0-1 | |
| Return | |
UARTReceive
| 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 | |
ADCSampleAverage10
I2CTransInit
SPIInitialise
| SPIInitialise | |
| Initialsie the SPI module ready for communications | |
| Channel | |
| Channel Index: Range 0 - SPI Bus Count - 1 | |
| Return | |
I2CSend
| I2CSend | |
| Transmit a byte using the I2C bus | |
| Channel | |
| Channel Index: Range 0 - I2C Bus Count - 1 | |
| DataOut | |
| Return | |
UARTSend
| 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
| PWMSetPrescaler | |
| Sets the prescaler for the PWM output | |
| Channel | |
| Range: 0-15 | |
| Prescaler | |
| Period | |
| Default 255 | |
| Return | |
PWMEnable
| PWMEnable | |
| Enable a PWM output | |
| Channel | |
| Range: 0-15 | |
| Return | |
ADCSampleArray10
ADCSampleAverage8
Initialise
| Initialise | |
| Initialise the comms to the Arduino board ready for commands to be sent. | |
| Return | |