Hey Everyone,
I'm just a beginner with Arduino and what I'm trying to do is take an incoming audio signal and then transmitted through a Bluetooth dongle. The Bluetooth dongle that I'm using for this is the Sennheiser BTD 800 USB Bluetooth Network Card. I've currently been messing about with this SPP sketch from the USB Host shield library 2.0. What I'm wanting to do is to display the incoming audio signal in the plotter window. If anyone has any ideas on how to program it to do this, it would be much appreciated.
#include <SPP.h>
#include <usbhub.h>
// Satisfy the IDE, which needs to see the include statment in the ino too.
#ifdef dobogusinclude
#include <spi4teensy3.h>
#endif
#include <SPI.h>
USB Usb;
// USBHub Hub1(&Usb); // Some dongles have a hub inside
BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so
/* You can create the instance of the class in two ways */
SPP SerialBT(&Btd); // This will set the name to the defaults: "Arduino" and the pin to "0000"
int incomingAudio = A0;
void setup() {
Serial.begin(9600);
#if !defined(__MIPSEL__)
while (!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection
#endif
if (Usb.Init() == -1) {
Serial.print(F("\r\nOSC did not start"));
while (1); //halt
pinMode(incomingAudio, INPUT); // set pin A0 to be input
}
}
void loop() {
Usb.Task(); // The SPP data is actually not send until this is called, one could call SerialBT.send() directly as well
(SerialBT.connected); {
incomingAudio = analogRead(A0);
SerialBT.println((incomingAudio)); // Send INCOMING AUDIO
}
{
if (Serial.available())
SerialBT.write(Serial.read());
if (SerialBT.available())
Serial.write(SerialBT.read());
}
}