Use the orientation of your smartphone to trigger hardware action or control motors.
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.
Orientation sensors measures degrees of rotation that the device make around for all 3 Axis(x,y & z). Orientation sensor Library allows arduino to get measured orientaion degrees from the smartphone.
Adding #define CUSTOM_SETTINGS along with #define INCLUDE_ORIENTATION_SENSOR_SHIELD is a key that will let you unlock the Orientation shield only amongst all shields and prevent 1Sheeld library from eating your memory specially for UNO board.
Note: Orientation vectors differs from device to device so please check them before writing your code.
Gets orientation degree on the X-axis of your smartphone.
Returns a float holding orientation value on the X-axis.
float xValue = OrientationSensors.getX();
Gets orientation degree on the Y-axis of your smartphone.
Returns a float holding orientation value on the Y-axis.
float yValue = OrientationSensors.getY();
Gets orientation degree on the Z-axis of your smartphone.
Returns a float holding orientation value on the Z-axis.
&userFunctionName: takes the physical address of the userFunction in the memory and jump to it once called to execute it’s functionality.
/* myFunction exists under the loop function. */
/* This function will be invoked each time a new value comes to arduino from the
smartphones orientation sensor. */
void myFunction (float xAxisValue, float yAxisValue, float zAxisValue)
/* Print x-y-z axis values on the Terminal Shield. */