-
Notifications
You must be signed in to change notification settings - Fork 2
Accelerometer
Victor Carreño edited this page Jan 28, 2015
·
1 revision
This section allow to interact with the 3 dimensional axis of the accelerometer sensor in your iOS Device and get their values.
Functions
short iShield::getXAxis()
short iShield::getYAxis()
short iShield::getZAxis()
Syntax
myiShield.getXAxis()
myiShield.getYAxis()
myiShield.getZAxis()
Returns
Short value
Parameters
None
Example
#include <boards.h>
#include <SPI.h>
#include <RBL_nRF8001.h>
#include "iShield.h"
iShield myiShield;
void setup()
{
// Init. and start BLE library.
ble_begin();
Serial.begin(9600);
ble_set_name("BLEShield");
}
void loop()
{
myiShield.getInbox();
short xAxis;
short yAxis;
short zAxis;
xAxis = myiShield.getXAxis();
yAxis = myiShield.getYAxis();
zAxis = myiShield.getZAxis();
Serial.println(xAxis);
Serial.println(yAxis);
Serial.println(zAxis);
}