Difference between revisions of "Component: Accel / Gyro 6-Axis (Grove 105020012) (Movement Orientation)"

From Flowcode Help
Jump to navigationJump to search
Line 16: Line 16:
  
 
==Component Source Code==
 
==Component Source Code==
 +
 +
Please click here to download the component source project: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_6-Axis_Accelerometer_&_Gyroscope.fcfx FC_Comp_Source_6-Axis_Accelerometer_&_Gyroscope.fcfx]
  
 
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_6-Axis_Accelerometer_&_Gyroscope.fcfx FC_Comp_Source_6-Axis_Accelerometer_&_Gyroscope.fcfx]
 
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_6-Axis_Accelerometer_&_Gyroscope.fcfx FC_Comp_Source_6-Axis_Accelerometer_&_Gyroscope.fcfx]
  
 
==Detailed description==
 
==Detailed description==
 +
 +
  
  
Line 40: Line 44:
  
 
==Examples==
 
==Examples==
 +
 +
  
  
Line 62: Line 68:
  
 
==Macro reference==
 
==Macro reference==
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetAccelReading'''
 +
|-
 +
| colspan="2" | Collects one of the accelerometer readings from the last sample. 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Axis
 +
|-
 +
| colspan="2" | 0=X, 1=Y, 2=Z 
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| 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;" | '''SampleDevice'''
 +
|-
 +
| colspan="2" | Collects the accelerometer, gyro and temperature readings from the device, 
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetGyroReading'''
 +
|-
 +
| colspan="2" | Collects one of the gyroscope readings from the last sample. 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Axis
 +
|-
 +
| colspan="2" | 0=X, 1=Y, 2=Z 
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| 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;" | '''GetTemperatureReading'''
 +
|-
 +
| colspan="2" | Collects the Temperature readings from the last sample. 
 +
|-
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| 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;" | '''ReadRegister'''
 +
|-
 +
| colspan="2" | Reads the value from one of the registers onboard the device. 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Reg
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteRegister'''
 +
|-
 +
| colspan="2" | Sets the value of one of the registers on the device. 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Reg
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 +
|-
 +
| colspan="2" | Startup the I2C bus and configure the device. Returns 0 if the device is ok and 255 if the device is not responding correctly. 
 +
|-
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
 +
 +
==Property reference==
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
 +
|-
 +
|-
 +
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Device Specific
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | Gyro Range
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | Accel Range
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 +
| width="90%" | Device Address
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | Channel selection 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 +
| width="90%" | SDA
 +
|-
 +
| colspan="2" | Pin used for SDA (data signal) 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 +
| width="90%" | SCL
 +
|-
 +
| colspan="2" | Pin used for SCL (clock signal) 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | Baud Select
 +
|-
 +
| colspan="2" | Baud rate option selector 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | Baud Rate
 +
|-
 +
| colspan="2" | Baud rate to be used 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 +
| width="90%" | Stop Delay
 +
|-
 +
| colspan="2" | On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not  a 10ms delay between an I2C stop event and the next I2C start event.  Most modern microcontrollers will not have a problem so this property can be disabled to speed up the  I2C communications.  
 +
|-
 +
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | Simulate Comms
 +
|-
 +
| colspan="2" | Chooses the data source for simulation.  
 +
|}==Macro reference==
  
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"

Revision as of 15:19, 20 January 2023

Author Matrix Ltd
Version 1.1
Category Movement Orientation


Accel / Gyro 6-Axis (Grove 105020012) component

Combined 6-Axis Accelerometer and Gyroscope sensors. Useful for working out data such as Pitch and Roll. Can be combined with a Magnetometer to also provide Yaw.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_6-Axis_Accelerometer_&_Gyroscope.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_6-Axis_Accelerometer_&_Gyroscope.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples


Macro reference

Fc9-comp-macro.png GetAccelReading
Collects one of the accelerometer readings from the last sample. 
Fc9-u8-icon.png - BYTE Axis
0=X, 1=Y, 2=Z 
Fc9-s16-icon.png - INT Return


Fc9-comp-macro.png SampleDevice
Collects the accelerometer, gyro and temperature readings from the device, 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetGyroReading
Collects one of the gyroscope readings from the last sample. 
Fc9-u8-icon.png - BYTE Axis
0=X, 1=Y, 2=Z 
Fc9-s16-icon.png - INT Return


Fc9-comp-macro.png GetTemperatureReading
Collects the Temperature readings from the last sample. 
Fc9-s16-icon.png - INT Return


Fc9-comp-macro.png ReadRegister
Reads the value from one of the registers onboard the device. 
Fc9-u8-icon.png - BYTE Reg
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png WriteRegister
Sets the value of one of the registers on the device. 
Fc9-u8-icon.png - BYTE Reg
 
Fc9-u8-icon.png - BYTE Data
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Initialise
Startup the I2C bus and configure the device. Returns 0 if the device is ok and 255 if the device is not responding correctly. 
Fc9-u8-icon.png - BYTE Return



Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Device Specific
Fc9-type-16-icon.png Gyro Range
 
Fc9-type-16-icon.png Accel Range
 
Fc9-type-21-icon.png Device Address
 
Fc9-conn-icon.png Connections
Fc9-type-16-icon.png Channel
Channel selection 
Fc9-type-5-icon.png SDA
Pin used for SDA (data signal) 
Fc9-type-5-icon.png SCL
Pin used for SCL (clock signal) 
Fc9-type-16-icon.png Baud Select
Baud rate option selector 
Fc9-type-14-icon.png Baud Rate
Baud rate to be used 
Fc9-type-7-icon.png Stop Delay
On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not a 10ms delay between an I2C stop event and the next I2C start event. Most modern microcontrollers will not have a problem so this property can be disabled to speed up the I2C communications.  
Fc9-conn-icon.png Simulation
Fc9-type-16-icon.png Simulate Comms
Chooses the data source for simulation.  

==Macro reference==

Fc9-comp-macro.png GetAccelReading
Collects one of the accelerometer readings from the last sample. 
Fc9-u8-icon.png - BYTE Axis
0=X, 1=Y, 2=Z 
Fc9-s16-icon.png - INT Return


Fc9-comp-macro.png SampleDevice
Collects the accelerometer, gyro and temperature readings from the device, 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetGyroReading
Collects one of the gyroscope readings from the last sample. 
Fc9-u8-icon.png - BYTE Axis
0=X, 1=Y, 2=Z 
Fc9-s16-icon.png - INT Return


Fc9-comp-macro.png GetTemperatureReading
Collects the Temperature readings from the last sample. 
Fc9-s16-icon.png - INT Return


Fc9-comp-macro.png ReadRegister
Reads the value from one of the registers onboard the device. 
Fc9-u8-icon.png - BYTE Reg
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png WriteRegister
Sets the value of one of the registers on the device. 
Fc9-u8-icon.png - BYTE Reg
 
Fc9-u8-icon.png - BYTE Data
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Initialise
Startup the I2C bus and configure the device. Returns 0 if the device is ok and 255 if the device is not responding correctly. 
Fc9-u8-icon.png - BYTE Return



Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Device Specific
Fc9-type-16-icon.png Gyro Range
 
Fc9-type-16-icon.png Accel Range
 
Fc9-type-21-icon.png Device Address
 
Fc9-conn-icon.png Connections
Fc9-type-16-icon.png Channel
Channel selection 
Fc9-type-5-icon.png SDA
Pin used for SDA (data signal) 
Fc9-type-5-icon.png SCL
Pin used for SCL (clock signal) 
Fc9-type-16-icon.png Baud Select
Baud rate option selector 
Fc9-type-14-icon.png Baud Rate
Baud rate to be used 
Fc9-type-7-icon.png Stop Delay
On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not a 10ms delay between an I2C stop event and the next I2C start event. Most modern microcontrollers will not have a problem so this property can be disabled to speed up the I2C communications.  
Fc9-conn-icon.png Simulation
Fc9-type-16-icon.png Simulate Comms
Chooses the data source for simulation.  

==Macro reference==

Fc9-comp-macro.png GetAccelReading
Collects one of the accelerometer readings from the last sample. 
Fc9-u8-icon.png - BYTE Axis
0=X, 1=Y, 2=Z 
Fc9-s16-icon.png - INT Return


Fc9-comp-macro.png SampleDevice
Collects the accelerometer, gyro and temperature readings from the device, 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetGyroReading
Collects one of the gyroscope readings from the last sample. 
Fc9-u8-icon.png - BYTE Axis
0=X, 1=Y, 2=Z 
Fc9-s16-icon.png - INT Return


Fc9-comp-macro.png GetTemperatureReading
Collects the Temperature readings from the last sample. 
Fc9-s16-icon.png - INT Return


Fc9-comp-macro.png ReadRegister
Reads the value from one of the registers onboard the device. 
Fc9-u8-icon.png - BYTE Reg
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png WriteRegister
Sets the value of one of the registers on the device. 
Fc9-u8-icon.png - BYTE Reg
 
Fc9-u8-icon.png - BYTE Data
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Initialise
Startup the I2C bus and configure the device. Returns 0 if the device is ok and 255 if the device is not responding correctly. 
Fc9-u8-icon.png - BYTE Return



Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Device Specific
Fc9-type-16-icon.png Gyro Range
 
Fc9-type-16-icon.png Accel Range
 
Fc9-type-21-icon.png Device Address
 
Fc9-conn-icon.png Connections
Fc9-type-16-icon.png Channel
Channel selection 
Fc9-type-5-icon.png SDA
Pin used for SDA (data signal) 
Fc9-type-5-icon.png SCL
Pin used for SCL (clock signal) 
Fc9-type-16-icon.png Baud Select
Baud rate option selector 
Fc9-type-14-icon.png Baud Rate
Baud rate to be used 
Fc9-type-7-icon.png Stop Delay
On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not a 10ms delay between an I2C stop event and the next I2C start event. Most modern microcontrollers will not have a problem so this property can be disabled to speed up the I2C communications.  
Fc9-conn-icon.png Simulation
Fc9-type-16-icon.png Simulate Comms
Chooses the data source for simulation.