User Manual

pg. 26
Copyright © 2017- www.SingleTact.com
4.4 Example .NET API
This section provides some detail on the .NET API used to construct the PC GUI application.
Download the .NET Interface and demo application from www.singletact.com.
For convenience the low level PC interface is encapsulated in two .NET components.
1. ArduinoSingleTactDriver The basic Arduino interface. The user must create one of these.
2. SingleTact There can be multiple SingleTacts each with their own I
2
C address.
Creating a SingleTact interface is as simple as:
arduinoSingleTactDriver.Initialise(COMport); //Start Arduino driver
singleTact_.I2cAddressForCommunications = 0x04; //Set I2C address
singleTact_.Initialise(arduinoSingleTactDriver); //Start sensor
The sensor is read using the following:
SingleTactFrame newFrame = singleTact_.ReadSensorData(); //Get sensor data
if (null != newFrame) //If we have data
{//Process result}
Settings can be pulled from the sensor using:
singleTact_.PullSettingsFromHardware();
and sent to the sensor using:
singleTact_.PushSettingsToHardware();
NOTE: The sensor settings can be modified using commands such as:
singleTact_.Settings.ReferenceGain = ###