2016-09-09 19:19:35 -07:00
|
|
|
//Modified: Abhishek Malik <abhishek.malik@intel.com>
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include "a110x.h"
|
|
|
|
|
2016-09-19 15:45:22 -07:00
|
|
|
#include "upm_utilities.h"
|
|
|
|
|
2016-09-09 19:28:52 -07:00
|
|
|
int main()
|
2016-09-09 19:19:35 -07:00
|
|
|
{
|
2016-09-19 15:45:22 -07:00
|
|
|
a110x_context dev = a110x_init(2);
|
|
|
|
bool abc = 0;
|
|
|
|
while(1){
|
|
|
|
if(a110x_magnet_detected(dev, &abc) != UPM_SUCCESS){
|
2017-03-20 14:26:50 -07:00
|
|
|
printf("an error has occurred\n");
|
2016-09-19 15:45:22 -07:00
|
|
|
}
|
|
|
|
upm_delay(1);
|
|
|
|
printf("value retrieved: %d\n", abc);
|
|
|
|
}
|
2016-09-09 19:19:35 -07:00
|
|
|
|
2016-09-19 15:45:22 -07:00
|
|
|
return 0;
|
2016-09-09 19:19:35 -07:00
|
|
|
}
|