6 #include "../hubolib.h"
7 #include "../hubocfg.h"
22 int main(
int argc,
char* argv[])
29 printf (
"Usage: \n GetDigitalInput <digital input to read>\n example: GetDigitalInput 7 // this will read digital input 7 and return the result\n");
34 if (sscanf (argv[1],
"%d", &channel) != 1)
36 printf (
"Digital input could not be determined!\n");
48 printf (
"Error: Initialize\n");
59 bool bOutValue =
false;
65 printf (
"%s\n", bOutValue ?
"1" :
"0");
76 pthread_t threadHandle = pthread_self();
79 ret = pthread_getschedparam (threadHandle, &policy, ¶m);
84 param.sched_priority = sched_get_priority_max(policy);
85 ret = pthread_setschedparam(threadHandle, policy, ¶m);
const char * m_sI2CDevice
bool Initialize()
Initializes the library.
bool Set_Cycle_Time(long cycleTime)
Sets the backgrounds threads polling interval in ms.
void Uninitialize()
Releases any resources bound to the library.
bool Wait_For_MCP23017_Buffered_Values()
Waits until input and output buffers of the MCP23017 master are initialized from the hardware...