Gyroscope Shield acts as Arduino Shield via 1Sheeld

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

Buy 1Sheeld

Tinker with the Gyroscope sensor in your smartphone and turn on some LEDs while playing with the by getting the values on the 3-Axis (X, Y & Z), you can use it also to drive an Arduino controlled car.

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.

Gyroscope sensor measures rotational rate rad/s around a certain axis (x,y &z) .Gyroscope sensor Library allows Arduino board to deal with the Gyroscope sensor of your smartphone.

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

void getX(void)

Gets gyroscope change 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
GyroscopeSensor.getX();

RETURNS
Returns a float holding gyroscope’s value on the X-axis.

PARAMETERS
None.

USAGE
float xValue = GyroscopeSensor.getX();

 

void getY(void)

Gets gyroscope change 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
GyroscopeSensor.getY();

RETURNS
Returns a float holding gyroscope’s value on the Y-axis.

PARAMETERS
None.

USAGE
float yValue = GyroscopeSensor.getY();

 

void getZ(void)

Gets gyroscope change 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
GyroscopeSensor.getZ();

RETURNS
Returns a float holding gyroscope’s value on the Z-axis.

PARAMETERS
None.

USAGE
float zValue = GyroscopeSensor.getZ();

 

void setOnValueChange(void(*userFunction)(float,float,float))

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 the Arduino.

SYNTAX
GyroscopeSensor.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
GyroscopeSensor.setOnValueChange(&myFunction);
/* myFunction exists under the loop function. */
/* This function will be invoked each time a new value comes to arduino from the  
   smartphones gravity 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);
}