Arduino Mic Shield acts as Arduino Shield via 1Sheeld

Buy 1Sheeld
Arduino Mic Shield acts as Arduino Shield via 1Sheeld

Buy 1Sheeld

Use the sound level to trigger a hardware action, sense the level of noise to trigger an alarm, how about opening your door with a secret knock!

Basic I/O shields allows you to tap into your smartphone’s sensors and use in prototyping with Arduino, you can get information from the surrounding environment and use it to trigger a certain action.
Learn more from the basic I/O shields tutorial.

Mic library allows Arduino board to use the mic of your smartphone so that it can measures the level of noise in decibels (db) and take an action once a threshold reached.

Adding #define CUSTOM_SETTINGS along with #define INCLUDE_MIC_SHIELD is a key that will let you unlock the MIC shield only amongst all shields and prevent 1Sheeld library from eating your memory specially for UNO board.

Note

For Android M(6) or greater, there are permissions to be granted before using the Data Logger shield, please make sure to grant the permissions or else it may affect the application’s performance.

byte getValue(void)

Get noise level measured by the mic from the smarpthone.

 

SYNTAX
Mic.getValue( );

 

RETURNS
byte value of data.

 

PARAMETERS
None.

 

USAGE
byte value = Mic.getValue();

 

void stopRecording(void)

Stops recording voice data.

 

SYNTAX
Mic.stopRecording( );

 

RETURNS
None.

 

PARAMETERS
None.

 

USAGE
Mic.stopRecording();

 

void startRecording(void)

Start recording voice data.

 

SYNTAX
Mic.startRecording( );

 

RETURNS
None.

 

PARAMETERS
None.

 

USAGE
Mic.startRecording();

 

void startRecording(const char *)

Start recording voice data, given a certain file name when saved.

 

SYNTAX
Mic.startRecording(fileName);

 

RETURNS
None.

 

PARAMETERS
Takes a const char array holding the fileName to be saved.

 

USAGE
Mic.startRecording();

 

void startRecording(String)

Start recording voice data, given a certain file name when saved.

 

SYNTAX
Mic.startRecording(fileName);

 

RETURNS
None.

 

PARAMETERS
Takes a string object holding the fileName to be saved.

 

USAGE
String fileName = "Mic1";
Mic.startRecording(fileName);

 

void setOnValueChange(void(*userFunction)(byte))

Sets a certain individual function written by the user in the sketch to be called and runs its functionality once a new value of the mic is sensed.

 

SYNTAX
Mic.setOnValueChange(&userFunctionName);

 

RETURNS
None.

 

PARAMETERS
&userFunctionName: takes the physical address of the userFunction in the memory and jump to it once called to execute it’s functionality.

 

USAGE
Mic.setOnButtonChange(&myFunction);
/* myFunction exists under the loop function. */
/* This function will be invoked each time a new noise value is sensed by the mic. */
void myFunction (byte noiseValue)
{
    /*Print out the light values on the Terminal of the application. */
    Terminal.println(noiseValue);
}