6 #include "../hubolib.h"
21 int main(
int argc,
char* argv[])
28 printf (
"Usage: \n GetAnalogInput <analog input to read>\n example: GetAnalogInput 7 // this will read analog input 7 and return the result\n");
33 if (sscanf (argv[1],
"%d", &channel) != 1)
35 printf (
"Analog input could not be determined!\n");
42 printf (
"Error: Initialize\n");
56 unsigned long adcCount;
60 printf (
"%ld\n", adcCount);
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);
bool Wait_For_MCP3x08_Buffered_Values()
Waits until the input buffer of the MCP3x08 are initialized from the hardware.
#define MAX_MCP3x08_CHANNELS
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.