Version 1.0 - Library for Parallax OFN module 27903

Fork of OFN by Neha Kadam

Embed: (wiki syntax)

« Back to documentation index

OFN Class Reference

OFN Class Reference

Class for the Parallax OFN module 27903. More...

#include <ofn.h>

Public Member Functions

 OFN (PinName sda, PinName scl)
 Constructor.
bool checkMotion ()
 Function to check if motion has been detected Checks the 7th bit of MOTION register and Returns true if motion detected else returns false.
int readX ()
 Function to get displacement in the X direction Returns an integer value.
int readY ()
 Function to get displacement in the X direction Returns an integer value.
int readOrientation ()
 Function to read the Orientation register Returns an integer value 1 - default orientation 0 - rotated by 90 degrees.

Detailed Description

Class for the Parallax OFN module 27903.

Definition at line 45 of file ofn.h.


Constructor & Destructor Documentation

OFN ( PinName  sda,
PinName  scl 
)

Constructor.

Parameters:
sdambed pin to use for SDA line of I2C interface.
sclmbed pin to use for SCL line of I2C interface.

Definition at line 23 of file ofn.cpp.


Member Function Documentation

bool checkMotion (  )

Function to check if motion has been detected Checks the 7th bit of MOTION register and Returns true if motion detected else returns false.

Definition at line 30 of file ofn.cpp.

int readOrientation (  )

Function to read the Orientation register Returns an integer value 1 - default orientation 0 - rotated by 90 degrees.

Definition at line 64 of file ofn.cpp.

int readX (  )

Function to get displacement in the X direction Returns an integer value.

Definition at line 42 of file ofn.cpp.

int readY (  )

Function to get displacement in the X direction Returns an integer value.

Definition at line 53 of file ofn.cpp.