44
Another example for the Esplora, this timw we will be using the on board microphone, again lets refer to a picture of the board
This time we will use the readMicrophone function
Description
Read the amplitude from the microphone. It returns a value between 0 and 1023.
Syntax
readMicrophone()
Parameters
none
Returns
int : The amplitude mapped to a range of 0 to 1023.
Code
[codesyntax lang=”cpp”]
#include <Esplora.h> void setup() { Serial.begin(9600); } void loop() { int value = Esplora.readMicrophone(); Serial.println(value); delay(1000); }
[/codesyntax]
Results
20
0
0
0
458
0
0
4
0
46