Configuration#
The Arduino code for trinteract can be found in the Software folder in the github repository. You can download the latest version by clicking the following link: https://github.com/gocivici/trinteract/archive/refs/heads/master.zip
Different Magnet#
the Arduino code comes configured and calibrated based on a 4x4mm neodymium magnet. If you want to use a different magnet or magnetic material like magnetic textiles etc. you have to configure the range of the magnetic field in the Arduino code.
First uncomment the following lines to open the serial port:
// uncomment the following line for debugging
Serial.begin(9600);
Serial.print(Tlv493dMagnetic3DSensor.getX());
Serial.print(Tlv493dMagnetic3DSensor.getY());
Serial.println(Tlv493dMagnetic3DSensor.getZ());
Next, upload the code to arduino and launch the serial monitor to see the new values. Now move the magnet to the maximum and minimum ends to determine the range of values.
Replace xMin
, xMax
, yMin
, yMax
, zMin
, zMax
with the new values.
int y = map((calX-Tlv493dMagnetic3DSensor.getX()),yMax,yMin,-64,64);
int x = map((calY-Tlv493dMagnetic3DSensor.getY()),xMax,xMin,-64,64);
int z = map((calZ-Tlv493dMagnetic3DSensor.getZ()),zMin,zMax,-64,64);