BSNOS
API
Accelerometer API
Gyroscope API
LEDS API
Magnetometer API
Radio API
Serial API
Timers API

Accelerometer API

short getAccelX()
Returns the X axis reading for a previously acquired accelerometer sample.

short getAccelY()
Returns the Y axis reading for a previously acquired accelerometer sample.

short getAccelZ()
Returns the Z axis reading for a previously acquired accelerometer sample.

void performAccelSample()
Instructs the driver to acquire an accelerometer sample.



Gyroscope API

short getGyroX()
Returns the X axis reading for a previously acquired gyroscope sample.

short getGyroY()
Returns the Y axis reading for a previously acquired gyroscope sample.

short getGyroZ()
Returns the Z axis reading for a previously acquired gyroscope sample.

void performGyroSample()
Instructs the driver to acquire a gyroscope sample.



LEDS API

void setLedState(byte ledNr, byte state)
Sets the state of the LED indicated by the ledNr parameter to on if state is 1, otherwise to off.

void toggleLed(byte ledNr)
Toggles the state of the LED indicated by the ledNr parameter.



Magnetometer API

short getMagX()
Returns the X axis reading for a previously acquired magnetometer sample.

short getMagY()
Returns the Y axis reading for a previously acquired magnetometer sample.

short getMagZ()
Returns the Z axis reading for a previously acquired magnetometer sample.

void performMagSample()
Instructs the driver to acquire a magnetometer sample.



Radio API

void appendByteToRadio(byte b)
Appends a byte, b, to the radio message buffer.

void appendFloatToRadio(float f)
Appends a float, f, to the radio message buffer.

void appendIntToRadio(int i)
Appends an int, i, to the radio message buffer.

void appendShortToRadio(short s)
Appends a short, s, to the radio message buffer.

byte getRadioReceivedByte(byte i)
Returns the ith byte of the received radio message.

byte receiveRadioFrame()
If a radio message has been received the return value will indicate the length of the received message. If not the return value will be 0.

byte sendRadioMsg(short destAddr)
Sends a radio message comprised of the content in the radio message buffer to the destination address, destAddr.

void setChannelId(byte channelId)
Sets the radio channel to the channel specified by channelId.

void setNodeId(short channelId)
Sets the node identifier used as the source identifier for sent messages to channelId.



Serial API

void sendSerialByte(byte b)
Sends the byte b over the serial connection.



Timers API

void waitMS(short ms)
Blocks the current thread of execution for ms number of milliseconds.