Browse Source

loudness: merge groveloudness and hyld9767 into a single driver

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Jon Trulson 9 years ago
parent
commit
9fe9d4aec2

+ 3
- 6
examples/c++/CMakeLists.txt View File

@@ -72,7 +72,6 @@ add_executable (grovelinefinder-example grovelinefinder.cxx)
72 72
 add_executable (grovevdiv-example grovevdiv.cxx)
73 73
 add_executable (grovewater-example grovewater.cxx)
74 74
 add_executable (guvas12d-example guvas12d.cxx)
75
-add_executable (groveloudness-example groveloudness.cxx)
76 75
 add_executable (mpr121-example mpr121.cxx)
77 76
 add_executable (ublox6-example ublox6.cxx)
78 77
 add_executable (yg1006-example yg1006.cxx)
@@ -140,7 +139,7 @@ add_executable (ak8975-example ak8975.cxx)
140 139
 add_executable (lsm9ds0-example lsm9ds0.cxx)
141 140
 add_executable (eboled-example eboled.cxx)
142 141
 add_executable (mpu9250-example mpu9250.cxx)
143
-add_executable (hyld9767-example hyld9767.cxx)
142
+add_executable (loudness-example loudness.cxx)
144 143
 add_executable (mg811-example mg811.cxx)
145 144
 add_executable (wheelencoder-example wheelencoder.cxx)
146 145
 add_executable (sm130-example sm130.cxx)
@@ -196,7 +195,6 @@ include_directories (${PROJECT_SOURCE_DIR}/src/grovelinefinder)
196 195
 include_directories (${PROJECT_SOURCE_DIR}/src/grovevdiv)
197 196
 include_directories (${PROJECT_SOURCE_DIR}/src/grovewater)
198 197
 include_directories (${PROJECT_SOURCE_DIR}/src/guvas12d)
199
-include_directories (${PROJECT_SOURCE_DIR}/src/groveloudness)
200 198
 include_directories (${PROJECT_SOURCE_DIR}/src/mpr121)
201 199
 include_directories (${PROJECT_SOURCE_DIR}/src/ublox6)
202 200
 include_directories (${PROJECT_SOURCE_DIR}/src/yg1006)
@@ -252,7 +250,7 @@ include_directories (${PROJECT_SOURCE_DIR}/src/rgbringcoder)
252 250
 include_directories (${PROJECT_SOURCE_DIR}/src/hp20x)
253 251
 include_directories (${PROJECT_SOURCE_DIR}/src/pn532)
254 252
 include_directories (${PROJECT_SOURCE_DIR}/src/lsm9ds0)
255
-include_directories (${PROJECT_SOURCE_DIR}/src/hyld9767)
253
+include_directories (${PROJECT_SOURCE_DIR}/src/loudness)
256 254
 include_directories (${PROJECT_SOURCE_DIR}/src/mg811)
257 255
 include_directories (${PROJECT_SOURCE_DIR}/src/wheelencoder)
258 256
 include_directories (${PROJECT_SOURCE_DIR}/src/sm130)
@@ -331,7 +329,6 @@ target_link_libraries (grovelinefinder-example grovelinefinder ${CMAKE_THREAD_LI
331 329
 target_link_libraries (grovevdiv-example grovevdiv ${CMAKE_THREAD_LIBS_INIT})
332 330
 target_link_libraries (grovewater-example grovewater ${CMAKE_THREAD_LIBS_INIT})
333 331
 target_link_libraries (guvas12d-example guvas12d ${CMAKE_THREAD_LIBS_INIT})
334
-target_link_libraries (groveloudness-example groveloudness ${CMAKE_THREAD_LIBS_INIT})
335 332
 target_link_libraries (mpr121-example mpr121 ${CMAKE_THREAD_LIBS_INIT})
336 333
 target_link_libraries (ublox6-example ublox6 ${CMAKE_THREAD_LIBS_INIT})
337 334
 target_link_libraries (yg1006-example yg1006 ${CMAKE_THREAD_LIBS_INIT})
@@ -399,7 +396,7 @@ target_link_libraries (ak8975-example mpu9150 ${CMAKE_THREAD_LIBS_INIT})
399 396
 target_link_libraries (lsm9ds0-example lsm9ds0 ${CMAKE_THREAD_LIBS_INIT})
400 397
 target_link_libraries (eboled-example i2clcd ${CMAKE_THREAD_LIBS_INIT})
401 398
 target_link_libraries (mpu9250-example mpu9150 ${CMAKE_THREAD_LIBS_INIT})
402
-target_link_libraries (hyld9767-example hyld9767 ${CMAKE_THREAD_LIBS_INIT})
399
+target_link_libraries (loudness-example loudness ${CMAKE_THREAD_LIBS_INIT})
403 400
 target_link_libraries (mg811-example mg811 ${CMAKE_THREAD_LIBS_INIT})
404 401
 target_link_libraries (wheelencoder-example wheelencoder ${CMAKE_THREAD_LIBS_INIT})
405 402
 target_link_libraries (sm130-example sm130 ${CMAKE_THREAD_LIBS_INIT})

+ 0
- 63
examples/c++/groveloudness.cxx View File

@@ -1,63 +0,0 @@
1
-/*
2
- * Author: Jon Trulson <jtrulson@ics.com>
3
- * Copyright (c) 2014 Intel Corporation.
4
- *
5
- * Permission is hereby granted, free of charge, to any person obtaining
6
- * a copy of this software and associated documentation files (the
7
- * "Software"), to deal in the Software without restriction, including
8
- * without limitation the rights to use, copy, modify, merge, publish,
9
- * distribute, sublicense, and/or sell copies of the Software, and to
10
- * permit persons to whom the Software is furnished to do so, subject to
11
- * the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be
14
- * included in all copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
- */
24
-
25
-#include <unistd.h>
26
-#include <iostream>
27
-#include <signal.h>
28
-#include "groveloudness.h"
29
-
30
-using namespace std;
31
-
32
-int shouldRun = true;
33
-
34
-void sig_handler(int signo)
35
-{
36
-  if (signo == SIGINT)
37
-    shouldRun = false;
38
-}
39
-
40
-
41
-int main ()
42
-{
43
-  signal(SIGINT, sig_handler);
44
-
45
-//! [Interesting]
46
-  // Instantiate a Grove Loudness sensor on analog pin A0
47
-  upm::GroveLoudness* loudness = new upm::GroveLoudness(0);
48
-
49
-  // Print the loudness value every 0.1 seconds
50
-  while (shouldRun)
51
-    {
52
-      int val = loudness->value();
53
-      cout << "Loudness value (higher is louder): " << val << endl;
54
-
55
-      usleep(100000);
56
-    }
57
-//! [Interesting]
58
-
59
-  cout << "Exiting" << endl;
60
-
61
-  delete loudness;
62
-  return 0;
63
-}

examples/c++/hyld9767.cxx → examples/c++/loudness.cxx View File

@@ -25,13 +25,13 @@
25 25
 #include <unistd.h>
26 26
 #include <iostream>
27 27
 #include <signal.h>
28
-#include "hyld9767.h"
28
+#include "loudness.h"
29 29
 
30 30
 using namespace std;
31 31
 
32 32
 bool shouldRun = true;
33 33
 
34
-#define HYLD9767_AREF   5.0
34
+#define LOUDNESS_AREF   5.0
35 35
 
36 36
 void sig_handler(int signo)
37 37
 {
@@ -45,9 +45,9 @@ int main()
45 45
 
46 46
 //! [Interesting]
47 47
 
48
-  // Instantiate a HYLD9767 on analog pin A0, with an analog
49
-  // reference voltage of HYLD9767_AREF
50
-  upm::HYLD9767 *loud = new upm::HYLD9767(0, HYLD9767_AREF);
48
+  // Instantiate a Loudness sensor on analog pin A0, with an analog
49
+  // reference voltage of LOUDNESS_AREF
50
+  upm::Loudness *loud = new upm::Loudness(0, LOUDNESS_AREF);
51 51
   
52 52
   // Every tenth of a second, sample the loudness and output it's
53 53
   // corresponding analog voltage. 

+ 0
- 43
examples/javascript/groveloudness.js View File

@@ -1,43 +0,0 @@
1
-/*jslint node:true, vars:true, bitwise:true, unparam:true */
2
-/*jshint unused:true */
3
-/*global */
4
-/*
5
-* Author: Zion Orent <zorent@ics.com>
6
-* Copyright (c) 2014 Intel Corporation.
7
-*
8
-* Permission is hereby granted, free of charge, to any person obtaining
9
-* a copy of this software and associated documentation files (the
10
-* "Software"), to deal in the Software without restriction, including
11
-* without limitation the rights to use, copy, modify, merge, publish,
12
-* distribute, sublicense, and/or sell copies of the Software, and to
13
-* permit persons to whom the Software is furnished to do so, subject to
14
-* the following conditions:
15
-*
16
-* The above copyright notice and this permission notice shall be
17
-* included in all copies or substantial portions of the Software.
18
-*
19
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22
-* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23
-* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
24
-* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
25
-* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26
-*/
27
-
28
-var loudnessSensor = require('jsupm_groveloudness');
29
-// Instantiate a Grove Loudness sensor on analog pin A0
30
-var myLoudnessSensor = new loudnessSensor.GroveLoudness(0);
31
-
32
-// Print the loudness value every 0.1 seconds
33
-setInterval(function()
34
-{
35
-	console.log("Loudness value (higher is louder): " + myLoudnessSensor.value());
36
-}, 100);
37
-
38
-// Print message when exiting
39
-process.on('SIGINT', function()
40
-{
41
-	console.log("Exiting...");
42
-	process.exit(0);
43
-});

examples/javascript/hyld9767.js → examples/javascript/loudness.js View File

@@ -26,11 +26,11 @@
26 26
  */
27 27
 
28 28
 
29
-var sensorObj = require('jsupm_hyld9767');
29
+var sensorObj = require('jsupm_loudness');
30 30
 
31
-// Instantiate a HYLD9767 on analog pin A0, with an analog
31
+// Instantiate a Loudness sensor on analog pin A0, with an analog
32 32
 // reference voltage of 5.0
33
-var sensor = new sensorObj.HYLD9767(0, 5.0);
33
+var sensor = new sensorObj.Loudness(0, 5.0);
34 34
 
35 35
 // Every tenth of a second, sample the loudness and output it's
36 36
 // corresponding analog voltage. 

+ 0
- 48
examples/python/groveloudness.py View File

@@ -1,48 +0,0 @@
1
-#!/usr/bin/python
2
-# Author: Zion Orent <zorent@ics.com>
3
-# Copyright (c) 2015 Intel Corporation.
4
-#
5
-# Permission is hereby granted, free of charge, to any person obtaining
6
-# a copy of this software and associated documentation files (the
7
-# "Software"), to deal in the Software without restriction, including
8
-# without limitation the rights to use, copy, modify, merge, publish,
9
-# distribute, sublicense, and/or sell copies of the Software, and to
10
-# permit persons to whom the Software is furnished to do so, subject to
11
-# the following conditions:
12
-#
13
-# The above copyright notice and this permission notice shall be
14
-# included in all copies or substantial portions of the Software.
15
-#
16
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
-# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
-# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
-# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
-
24
-import time, sys, signal, atexit
25
-import pyupm_groveloudness as upmGroveloudness
26
-
27
-# Instantiate a Grove Loudness sensor on analog pin A0
28
-myLoudness = upmGroveloudness.GroveLoudness(0)
29
-
30
-
31
-## Exit handlers ##
32
-# This stops python from printing a stacktrace when you hit control-C
33
-def SIGINTHandler(signum, frame):
34
-	raise SystemExit
35
-
36
-# This lets you run code on exit, including functions from myLoudness
37
-def exitHandler():
38
-	print "Exiting"
39
-	sys.exit(0)
40
-
41
-# Register exit handlers
42
-atexit.register(exitHandler)
43
-signal.signal(signal.SIGINT, SIGINTHandler)
44
-
45
-
46
-while (1):
47
-	print "Loudness value (higher is louder):", myLoudness.value()
48
-	time.sleep(.1)

examples/python/hyld9767.py → examples/python/loudness.py View File

@@ -22,11 +22,11 @@
22 22
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 23
 
24 24
 import time, sys, signal, atexit
25
-import pyupm_hyld9767 as sensorObj
25
+import pyupm_loudness as sensorObj
26 26
 
27
-# Instantiate a HYLD9767 on analog pin A0, with an analog
27
+# Instantiate a Loudness sensor on analog pin A0, with an analog
28 28
 # reference voltage of 5.0
29
-sensor = sensorObj.HYLD9767(0, 5.0)
29
+sensor = sensorObj.Loudness(0, 5.0)
30 30
 
31 31
 ## Exit handlers ##
32 32
 # This function stops python from printing a stacktrace when you hit control-C

+ 0
- 5
src/groveloudness/CMakeLists.txt View File

@@ -1,5 +0,0 @@
1
-set (libname "groveloudness")
2
-set (libdescription "upm grove loudness module")
3
-set (module_src ${libname}.cxx)
4
-set (module_h ${libname}.h)
5
-upm_module_init()

+ 0
- 77
src/groveloudness/groveloudness.h View File

@@ -1,77 +0,0 @@
1
-/*
2
- * Author: Jon Trulson <jtrulson@ics.com>
3
- * Copyright (c) 2014 Intel Corporation.
4
- *
5
- * Permission is hereby granted, free of charge, to any person obtaining
6
- * a copy of this software and associated documentation files (the
7
- * "Software"), to deal in the Software without restriction, including
8
- * without limitation the rights to use, copy, modify, merge, publish,
9
- * distribute, sublicense, and/or sell copies of the Software, and to
10
- * permit persons to whom the Software is furnished to do so, subject to
11
- * the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be
14
- * included in all copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
- */
24
-#pragma once
25
-
26
-#include <string>
27
-#include <mraa/aio.h>
28
-
29
-namespace upm {
30
-  /**
31
-   * @brief Grove Loudness sensor library
32
-   * @defgroup groveloudness libupm-groveloudness
33
-   * @ingroup seeed analog sound
34
-   */
35
-
36
-  /**
37
-   * @library groveloudness
38
-   * @sensor groveloudness
39
-   * @comname Grove Loudness Sensor
40
-   * @type sound
41
-   * @man seeed
42
-   * @con analog
43
-   *
44
-   * @brief API for the Grove Loudness Sensor
45
-   *
46
-   * UPM module for the Grove Loudness Sensor. This sensor
47
-   * detects how loud the surrounding environment is.
48
-   * The higher the output analog value, the louder the sound.
49
-   *
50
-   * @image html groveloudness.jpg
51
-   * @snippet groveloudness.cxx Interesting
52
-   */
53
-  class GroveLoudness {
54
-  public:
55
-    /**
56
-     * Grove analog loudness sensor constructor
57
-     *
58
-     * @param pin Analog pin to use
59
-     */
60
-    GroveLoudness(int pin);
61
-    /**
62
-     * GroveLoudness destructor
63
-     */
64
-    ~GroveLoudness();
65
-    /**
66
-     * Gets the loudness value from the sensor
67
-     *
68
-     * @return Loudness reading
69
-     */
70
-    int value();
71
-
72
-  private:
73
-    mraa_aio_context m_aio;
74
-  };
75
-}
76
-
77
-

+ 0
- 8
src/groveloudness/javaupm_groveloudness.i View File

@@ -1,8 +0,0 @@
1
-%module javaupm_groveloudness
2
-%include "../upm.i"
3
-
4
-%{
5
-    #include "groveloudness.h"
6
-%}
7
-
8
-%include "groveloudness.h"

+ 0
- 8
src/groveloudness/jsupm_groveloudness.i View File

@@ -1,8 +0,0 @@
1
-%module jsupm_groveloudness
2
-%include "../upm.i"
3
-
4
-%{
5
-    #include "groveloudness.h"
6
-%}
7
-
8
-%include "groveloudness.h"

+ 0
- 9
src/groveloudness/pyupm_groveloudness.i View File

@@ -1,9 +0,0 @@
1
-%module pyupm_groveloudness
2
-%include "../upm.i"
3
-
4
-%feature("autodoc", "3");
5
-
6
-%include "groveloudness.h"
7
-%{
8
-    #include "groveloudness.h"
9
-%}

+ 0
- 8
src/hyld9767/javaupm_hyld9767.i View File

@@ -1,8 +0,0 @@
1
-%module javaupm_hyld9767
2
-%include "../upm.i"
3
-
4
-%{
5
-    #include "hyld9767.h"
6
-%}
7
-
8
-%include "hyld9767.h"

+ 0
- 8
src/hyld9767/jsupm_hyld9767.i View File

@@ -1,8 +0,0 @@
1
-%module jsupm_hyld9767
2
-%include "../upm.i"
3
-
4
-%{
5
-    #include "hyld9767.h"
6
-%}
7
-
8
-%include "hyld9767.h"

+ 0
- 9
src/hyld9767/pyupm_hyld9767.i View File

@@ -1,9 +0,0 @@
1
-%module pyupm_hyld9767
2
-%include "../upm.i"
3
-
4
-%feature("autodoc", "3");
5
-
6
-%include "hyld9767.h"
7
-%{
8
-    #include "hyld9767.h"
9
-%}

src/hyld9767/CMakeLists.txt → src/loudness/CMakeLists.txt View File

@@ -1,5 +1,5 @@
1
-set (libname "hyld9767")
2
-set (libdescription "upm DFRobot loudness sensor")
1
+set (libname "loudness")
2
+set (libdescription "upm loudness sensors")
3 3
 set (module_src ${libname}.cxx)
4 4
 set (module_h ${libname}.h)
5 5
 upm_module_init()

+ 8
- 0
src/loudness/javaupm_loudness.i View File

@@ -0,0 +1,8 @@
1
+%module javaupm_loudness
2
+%include "../upm.i"
3
+
4
+%{
5
+    #include "loudness.h"
6
+%}
7
+
8
+%include "loudness.h"

+ 8
- 0
src/loudness/jsupm_loudness.i View File

@@ -0,0 +1,8 @@
1
+%module jsupm_loudness
2
+%include "../upm.i"
3
+
4
+%{
5
+    #include "loudness.h"
6
+%}
7
+
8
+%include "loudness.h"

src/hyld9767/hyld9767.cxx → src/loudness/loudness.cxx View File

@@ -24,23 +24,23 @@
24 24
 
25 25
 #include <iostream>
26 26
 
27
-#include "hyld9767.h"
27
+#include "loudness.h"
28 28
 
29 29
 using namespace std;
30 30
 using namespace upm;
31 31
 
32
-HYLD9767::HYLD9767(int pin, float aref) :
32
+Loudness::Loudness(int pin, float aref) :
33 33
   m_aio(pin)
34 34
 {
35 35
   m_aRes = m_aio.getBit();
36 36
   m_aref = aref;
37 37
 }
38 38
 
39
-HYLD9767::~HYLD9767()
39
+Loudness::~Loudness()
40 40
 {
41 41
 }
42 42
 
43
-float HYLD9767::loudness()
43
+float Loudness::loudness()
44 44
 {
45 45
   int val = m_aio.read();
46 46
 

src/hyld9767/hyld9767.h → src/loudness/loudness.h View File

@@ -27,54 +27,54 @@
27 27
 #include <string>
28 28
 #include <mraa/aio.hpp>
29 29
 
30
-// EZ series is volts/512
31
-#define HYLD9767_RES  512
32
-
33 30
 namespace upm {
34 31
   /**
35
-   * @brief DFRobot Loudness Sensor V2
36
-   * @defgroup hyld9767 libupm-hyld9767
37
-   * @ingroup dfrobot analog sound
32
+   * @brief Generic loudness sensors
33
+   * @defgroup loudness libupm-loudness
34
+   * @ingroup dfrobot seeed analog sound
38 35
    */
39 36
 
40 37
   /**
41
-   * @library hyld9767
42
-   * @sensor hyld9767
43
-   * @comname DFRobot Loudness Sensor V2
44
-   * @altname HYLD9767
38
+   * @library loudness
39
+   * @sensor loudness
40
+   * @comname Loudness Sensor
41
+   * @altname Grove loudness hyld9767
45 42
    * @type sound
46
-   * @man dfrobot
43
+   * @man dfrobot seeed
47 44
    * @web http://www.dfrobot.com/index.php?route=product/product&product_id=83
48 45
    * @con analog
49 46
    *
50
-   * @brief API for the DFRobot Loudness Sensor V2
47
+   * @brief API for the Loudness Sensor
51 48
    *
52
-   * This sensor returns an analog voltage proportional to the
49
+   * This sensor family returns an analog voltage proportional to the
53 50
    * loudness of the ambient environment.  It's output does not
54
-   * correspond to a particular sound level in decibels.
51
+   * correspond to a particular sound level in decibels.  The higher
52
+   * the output voltage, the louder the ambient noise level.
55 53
    *
56
-   * This device uses an HYLD9767 electret microphone for sound input.
54
+   * This device uses an electret microphone for sound input.
57 55
    *
58 56
    * This driver was developed using the DFRobot Loudness Sensor V2
57
+   * and the Grove Loudness sensor.
59 58
    *
60
-   * @snippet hyld9767.cxx Interesting
59
+   * @image html groveloudness.jpg
60
+   * @snippet loudness.cxx Interesting
61 61
    */
62 62
 
63
-  class HYLD9767 {
63
+  class Loudness {
64 64
   public:
65 65
 
66 66
     /**
67
-     * HYLD9767 constructor
67
+     * Loudness constructor
68 68
      *
69 69
      * @param pin Analog pin to use
70 70
      * @param aref Analog reference voltage; default is 5.0 V
71 71
      */
72
-    HYLD9767(int pin, float aref=5.0);
72
+    Loudness(int pin, float aref=5.0);
73 73
 
74 74
     /**
75
-     * HYLD9767 destructor
75
+     * Loudness destructor
76 76
      */
77
-    ~HYLD9767();
77
+    ~Loudness();
78 78
 
79 79
     /**
80 80
      * Returns the voltage detected on the analog pin

+ 9
- 0
src/loudness/pyupm_loudness.i View File

@@ -0,0 +1,9 @@
1
+%module pyupm_loudness
2
+%include "../upm.i"
3
+
4
+%feature("autodoc", "3");
5
+
6
+%include "loudness.h"
7
+%{
8
+    #include "loudness.h"
9
+%}