IFD:EAI SoS21/course material/Session 6: Getting Started with Teensyduino: Difference between revisions

From Medien Wiki
No edit summary
No edit summary
Line 10: Line 10:
#*# from "output" add "i2s"
#*# from "output" add "i2s"
#*# from "control" add "sgtl5000" [[File:teensy_webinterface.png|thumb|690px|Audio System Design Tool "Audio through patch"]]
#*# from "control" add "sgtl5000" [[File:teensy_webinterface.png|thumb|690px|Audio System Design Tool "Audio through patch"]]
# Click the export button to generate the setup code for your teensy and paste it in your Arduino IDE patch!
# Click the export button to generate the setup code for your teensy and paste it in your Arduino IDE patch, just before the setup routine!
# In the setup routine of the arduino IDE you need code to choose the microphone port and audio levels. It should look more or less like this:<syntaxhighlight lang="c++">
# In the setup routine of the arduino IDE you need code to choose the microphone port and audio levels. It should look more or less like this:<syntaxhighlight lang="c++">
void setup() {
void setup() {
Line 23: Line 23:
   sgtl5000_1.volume(0.8); // from 0.0 to 1.0 // 0.8 standard
   sgtl5000_1.volume(0.8); // from 0.0 to 1.0 // 0.8 standard
}
}
 
</syntaxhighlight>
Note that you really need to declare the loop() function, otherwise your code doesn't compile!
<syntaxhighlight lang="c++">
void loop(){
void loop(){
// nothing to be done here
// nothing to be done here