mbed Sensor node for Instrumented Booth over ETH.

Dependencies:   EthernetInterface-1 MaxbotixDriver Presence HTU21D_TEMP_HUMID_SENSOR_SAMPLE Resources SHARPIR mbed-rtos mbed-src WDT_K64F nsdl_lib

Fork of Trenton_Switch_LPC1768_ETH by Demo Team

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MAX9814.h Source File

MAX9814.h

00001 /*
00002     MAX9814.h - MAX9814 sensor library
00003     Developed by Andrea Corrado   
00004 */
00005 
00006 /*
00007     Example 'main.cpp'
00008 
00009 #include "mbed.h"
00010 #include "MAX9814.h"
00011 Serial pc (USBTX, USBRX);
00012 
00013 
00014 MAX9814 mic(p20);
00015 
00016 int main()
00017 {
00018     while (1) {
00019         mic.volume_indicator();
00020         pc.printf("\n\r Level is %f", mic.sound_level());
00021     }
00022 }
00023 
00024 */
00025 
00026 #ifndef MBED_MIC_H
00027 #define MBED_MIC_H
00028 
00029 #include "mbed.h"
00030 
00031 class MAX9814 {
00032     
00033 public:
00034 
00035     MAX9814(PinName pin); //Analogue in
00036     float sound_level();
00037 
00038 protected:
00039     AnalogIn _pin;
00040     float _value;
00041     float _sample;
00042     Timer _t,_t1;
00043 };
00044 
00045 #endif