When I plug my Teensy into my computer with a USB cable (I know its not the cable or USB port because my other Teensy works fine) it will receive power and it will power my LEDs (super basic code) but my computer will not recognize it as a USB device. Hoping there's a quick fix to this, not sure what other information to provide, this was the last thing I was able to reboot onto my Teensy before this issue started occuring:
Thanks
Code:
#include <Audio.h>
#include <Wire.h>
#include <SD.h>
#include <SPI.h>
#include <SerialFlash.h>
#include <Bounce.h>
AudioSynthWaveform waveform1;
AudioOutputI2S i2s1;
AudioConnection patchCord1(waveform1, 0, i2s1, 0);
AudioConnection patchCord2(waveform1, 0, i2s1, 1);
AudioControlSGTL5000 sgtl5000_1;
Bounce button0 = Bounce(0, 15);
Bounce button1 = Bounce(1, 15);
Bounce button2 = Bounce(2, 15);
int count=1;
int a1history=0, a2history=0, a3history=0;
void setup() {
AudioMemory(10);
pinMode(0, OUTPUT);
pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
Serial.begin(115200);
sgtl5000_1.enable();
sgtl5000_1.volume(0.3);
waveform1.begin(WAVEFORM_SINE);
delay(1000);
analogWrite(0,0);
analogWrite(1,160);
analogWrite(2,80);
a1history = analogRead(A1);
a2history = analogRead(A2);
a3history = analogRead(A3);
}
void loop() {
Serial.print("Beep #");
Serial.println(count);
count = count + 1;
waveform1.frequency(440);
waveform1.amplitude(0.9);
wait(250);
waveform1.amplitude(0);
wait(1750);
}
void wait(unsigned int milliseconds)
{
elapsedMillis msec=0;
while (msec <= milliseconds) {
int a1 = analogRead(A1);
int a2 = analogRead(A2);
int a3 = analogRead(A3);
if (a1 > a1history + 50 || a1 < a1history - 50) {
Serial.print("Knob (pin A1) = ");
Serial.println(a1);
a1history = a1;
}
if (a2 > a2history + 50 || a2 < a2history - 50) {
Serial.print("Knob (pin A2) = ");
Serial.println(a2);
a2history = a2;
}
if (a3 > a3history + 50 || a3 < a3history - 50) {
Serial.print("Knob (pin A3) = ");
Serial.println(a3);
a3history = a3;
}
}
}
Thanks