upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Data Structures | Functions | Typedefs
Include dependency graph for loudness.h:

API Description

//Modified: Abhishek Malik <abhishek.malik@intel.com>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "loudness.h"
#include "upm_utilities.h"
int main()
{
int val;
while(1){
if(loudness_get_value(dev, &val) != UPM_SUCCESS){
printf("Failed to get any values from the sensor\n");
}
printf("Loudness Value: %d\n", val);
upm_delay(1);
}
return 0;
}

Go to the source code of this file.

Data Structures

struct  _loudness_context
 

Functions

loudness_context loudness_init (int pin)
 
void loudness_close (loudness_context dev)
 
upm_result_t loudness_get_value (loudness_context dev, int *val)
 

Typedefs

typedef struct _loudness_contextloudness_context
 

Function Documentation

loudness_context loudness_init ( int  pin)

Loudness Initialization function

Parameters
pinAIO pin to use
Returns
void* pointer to the sensor struct
void loudness_close ( loudness_context  dev)

Loudness destructor

Parameters
void*pointer to the sensor struct
upm_result_t loudness_get_value ( loudness_context  dev,
int *  val 
)

Function gets the loudness raw value (currently)

Parameters
void*pointer to the sensor struct
int*pointer to store the loudness value.
Returns
upm_result_t UPM success/error code

Typedef Documentation

device context