Skip to content

RPi API

jaenrig-ifx edited this page Nov 5, 2020 · 3 revisions

Basic API usage:

Include the hall switch library

#include "hall-switch-rpi.hpp"

Create an object from the HallSwitchRpi class

HallSwitchRpi    hs( TLE4964_3M_S2Go_Rpi_Adapter_Slot_1 );

When using the Shield2Go adapter for Raspberry Pi, the argument of the constructor is

TLE4964_3M_S2Go_Rpi_Adapter_Slot_<adapter slot number>

Initalize the hall switch

hs.init();

Update the hall switch status

hs.updateBField();

Get the status of the hall switch at last update

hs.getBField();

Find the complete documentation for each of the Raspberry Pi functions and rest of the library code structures in the Raspberry Pi Doxygen docs section.