curtis newton
Member
Hello,
I try to have a simple led heartbeat but it stops working as soon as I use more than one AudioInputAnalog in my sketch
there are like 20 ADC on the teensy, how can I use them all ? is it not possible ?
I just found out AudioInputAnalogStereo , but its only 2 channels, what if you want to do an autio mixer with the teensy ? 20 mono channels or 10 stereo channels ?
regards
I try to have a simple led heartbeat but it stops working as soon as I use more than one AudioInputAnalog in my sketch
there are like 20 ADC on the teensy, how can I use them all ? is it not possible ?
I just found out AudioInputAnalogStereo , but its only 2 channels, what if you want to do an autio mixer with the teensy ? 20 mono channels or 10 stereo channels ?
regards
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioInputAnalog adc2(A5);
//AudioInputAnalog adc1(A4); // uncommenting this line seem to crash the program
AudioMixer4 mixer1;
AudioAmplifier amp1;
AudioOutputAnalog dac0;
//AudioConnection patchCord1(adc2, 0, mixer1, 1);
//AudioConnection patchCord2(adc1, 0, mixer1, 0);
AudioConnection patchCord3(mixer1, amp1);
AudioConnection patchCord4(amp1, dac0);
// GUItool: end automatically generated code
//---------------------------------------------------------------------------
#define LED_PIN 13
unsigned long long heartbeat=0;
void setup() {
pinMode(LED_PIN, OUTPUT);
}
void loop() {
if(heartbeat==0)
{
digitalWrite(LED_PIN, HIGH); // set the LED on
}
else if(heartbeat==480000)
{
digitalWrite(LED_PIN, LOW); // set the LED off
}
heartbeat++;
if(heartbeat>=960000)
{
heartbeat=0;
}
}