2017-03-08 23:28:45 -08:00
|
|
|
/*
|
|
|
|
* Author: Abhishek Malik <abhishek.malik@intel.com>
|
|
|
|
* Copyright (c) 2017 Intel Corporation.
|
|
|
|
*
|
2019-07-30 19:41:32 -07:00
|
|
|
* This program and the accompanying materials are made available under the
|
|
|
|
* terms of the The MIT License which is available at
|
|
|
|
* https://opensource.org/licenses/MIT.
|
2017-03-08 23:28:45 -08:00
|
|
|
*
|
2019-07-30 19:41:32 -07:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-03-08 23:28:45 -08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
2017-04-04 13:38:28 -07:00
|
|
|
#include "abp.h"
|
2017-03-08 23:28:45 -08:00
|
|
|
|
|
|
|
#include "upm_utilities.h"
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
2017-04-04 13:38:28 -07:00
|
|
|
abp_context dev = abp_init(0, ABP_DEFAULT_ADDRESS);
|
2017-03-08 23:28:45 -08:00
|
|
|
if(dev == NULL) {
|
|
|
|
printf("Unable to initialize sensor\n");
|
|
|
|
return 0;
|
|
|
|
}
|
2017-04-04 13:38:28 -07:00
|
|
|
|
2017-03-08 23:28:45 -08:00
|
|
|
while(1){
|
2017-04-04 13:38:28 -07:00
|
|
|
abp_update(dev);
|
|
|
|
printf("Retrieved pressure value: %f\n", abp_get_pressure(dev));
|
|
|
|
printf("Retrieved temperature value: %f\n", abp_get_temperature(dev));
|
2017-03-08 23:28:45 -08:00
|
|
|
upm_delay(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
2017-04-04 13:38:28 -07:00
|
|
|
}
|