Propeller Activity Board WX, Propeller FLiP module, or Other board types. Propeller I/O pin availability will vary by board type. Not available for Badge or Scribbler Robot board types.
These blocks are for using the MEMSIC2125 Dual-Axis Accelerometer (#28017) [1].
New to this sensor? Click here to see an example schematic and quick Blockly program [2] to help you get started.
The PIN menu on all of the Memsic 2-Axis blocks can be set to "other." When "other" is chosen, the dropdown menu disappears, and it is replaced with an input. You can then use any block that provides a numeric value such as a number value, get variable, or constant value block:
The Memsic x acceleration block returns the approximate acceleration measured by the Memsic sensor. Acceleration is measured in terms of g (acceleration due to earth's gravity): a value of +/-1250 corresponds to approximately +/- 1 g.
Set the PIN dropdown to the Propeller I/O pin connected to the sensor’s Xout pin.
The Memsic y acceleration block returns the approximate acceleration measured by the Memsic sensor. Acceleration is measured in terms of g (acceleration due to earth's gravity): a value of +/-1250 corresponds to approximately +/- 1 g.
Set the PIN dropdown to the Propeller I/O pin connected to the sensor’s Yout pin.
The Memsic rotation block measures how much the sensor is rotated if it is held vertically (zero degrees is when the triangle on the Memsic sensor is pointed straight up. The sensor returns a measurement in degrees where 0 degrees is straight up, and 180 degrees is straight down.
Set the PIN dropdowns to the Propeller I/O pin connected to the sensor’s Xout and Yout pins.
The Memsic x tilt block returns a measurement of how much the sensor has tilted in the x (sideways) direction when the top of the sensor is level with the ground. The value returned is +/- 90 degrees.
Set the PIN dropdown to the Propeller I/O pin connected to the sensor’s Xout pin.
The Memsic y tilt block returns a measurement of how much the sensor has tilted in the x (front to back) direction when the top of the sensor is level with the ground. The value returned is +/- 90 degrees.
Set the PIN dropdown to the Propeller I/O pin connected to the sensor’s Yout pin.
The Memsic MX2125 Dual-axis Accelerometer is great for measuring tilt, vibration, rotation, and let’s not forget its namesake, acceleration. A few MX2125 project ideas might include a tilt video game controller, tilt robot controller, robot hill climbing sensor, and radio-controlled vehicle acceleration, speed, and position data logger.
Using the connections shown in the wiring diagram above, this example will display X and Y tilt in the Terminal.
Links
[1] http://www.parallax.com/product/28017
[2] https://learn.parallax.com/support/reference/activity-board-wx-block-reference/sensor/memsic-2-axis/memsic-2125-wiring-example