Accelerometer Shield acts as Arduino Shield via 1Sheeld

Buy 1Sheeld
Accelerometer Shield acts as Arduino Shield via 1Sheeld

Buy 1Sheeld

Get the acceleration of a moving objects is easier now by writing a simple line in your sketch, the shield gets you the data of X, Y and Z axis of the accelerometer sensor in your smartphone.
Learn more from the examples page.

This shield is one of the sensor shields. Sensor shields allows you to tap into your smartphone’s sensors and use in prototyping with Arduino, you can get information from the surrounding environment and use it to trigger a certain action. Learn more from the sensor shields tutorial.

Accelerometer sensor measures the acceleration forces in m/s2 that is applied to the device on all three physical axis (x, y and z) including the force of gravity.Range: 0–>20 m/s2 forSamsung galaxy S3, note that this range differs from device to another.

Adding #define CUSTOM_SETTINGS along with #define INCLUDE_ACCELEROMETER_SENSOR_SHIELD is a key that will let you unlock the Accelerometer sensor shield only amongst all shields and prevent 1Sheeld library from eating your memory specially for UNO board.

Gets acceleration vector on the X-axis of your smartphone.

Note: every smartphone has it’s own directed axis so don’t count them on the examples.

SYNTAX

AccelerometerSensor.getX();

RETURNS

float acceleration value on the X-axis and needs a float variable to deal with.

PARAMETERS

None.

USAGE

float xValue = AccelerometerSensor.getX();

Gets acceleration vector on the Y-axis of your smartphone.

Note: every smartphone has it’s own directed axis so don’t count them on the examples.

SYNTAX

AccelerometerSensor.getY();

RETURNS

float acceleration value on the Y-axis and needs a float variable to deal with.

PARAMETERS

None.

USAGE

float yValue = AccelerometerSensor.getY();

Gets acceleration vector on the Z-axis of your smartphone.

Note: every smartphone has it’s own directed axis so don’t count them on the examples.

SYNTAX

AccelerometerSensor.getZ( );

RETURNS

float acceleration value on the Z-axis and needs a float variable to deal with.

PARAMETERS

None.

USAGE

float zValue = AccelerometerSensor.getZ();

Sets a certain individual function written by the user in the sketch to be called and runs its functionality once a new value is sensed and sent by the application to Arduino.

SYNTAX

AccelerometerSensor.setOnValueChange(&userFunctionName);

RETURNS

None.

PARAMETERS

&userFunctionName: takes the physical address of the userFunction in the memory and jump to it once called to execute it’s functionality.

USAGE

void setup()
{
  OneSheeld.begin();
  AccelerometerSensor.setOnValueChange(&myFunction);  
}

void loop()
{
  /*Write code or leave it empty both will work. */
}

/* myFunction exists under the loop function. */
/* This function will be invoked each time a new value comes to arduino from the
   smartphones accelerometer sensor. */
void myFunction (float xAxisValue, float yAxisValue, float zAxisValue)
{
   /* Print x-y-z axis values on the Terminal Shield. */
   Terminal.println(xAxisValue);
   Terminal.println(yAxisValue);
   Terminal.println(zAxisValue);
}