Created
April 30, 2014 03:08
-
-
Save arjo129/9c73ec533b2b1a6f91b4 to your computer and use it in GitHub Desktop.
debug uspeech file from 4.1.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <uspeech.h> | |
signal voice(A0); | |
char option = 0; | |
void setup(){ | |
voice.calibrate(); | |
voice.f_enabled = true; | |
Serial.begin(9600); | |
} | |
void loop(){ | |
//voice.sample(); | |
char c=voice.getPhoneme(); | |
if(option==0){ | |
Serial.println("uSpeech debug tool--------"); | |
Serial.println(" Press 'a' if you wish to calibrate/check the f algorithm"); | |
Serial.println(" Press 'b' if you wish to calibrate/check the getPhoneme"); | |
Serial.println(" Press 'c' if you wish to calibrate/check the volume of your microphone"); | |
Serial.println(" Press 'd' if you wish to calibrate/check the coeff"); | |
option = 1; | |
} | |
if(option==1){ | |
if (Serial.available() > 0) { | |
// read the incoming byte: | |
option = Serial.read(); | |
} | |
} | |
if(option=='a'){ | |
Serial.println(voice.micPower); | |
} | |
if(option=='b'){ | |
Serial.println(c); | |
} | |
if(option=='c'){ | |
Serial.println(voice.power()); | |
} | |
if(option=='d'){ | |
Serial.println(voice.testCoeff); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment