Carlo alfisi
Member
Hi everyone, I'm working on a project with teensy 3.6, audio board and the module hc-05. I use the virtuino app to communicate with the module https://play.google.com/store/apps/details?id=com.virtuino_automations.virtuino&hl=it. I wanted to verify if they could work toghether, therefore I wrote two scripts.
The first is a simple Passthrough for the audio shield
I compile it and it works well.
the second script aims to verify whether the virtuino app talks to the teensy, so I wrote this second code
I connect the VGG to the Vin (since hc-05 require 3.6-6V, using the usb port to power teensy), in the app I added a virtual switch and it works well. I also tried to use differents rx&tx pin, 31 and 32, but it doesn't work, if someone know the reason why I'd like to know, but it's not so important.
Finally I merged all together to try if I could control an audio project using the virtuino app. So I wrote this code:
It's simply the previous two scripts in one. Then I filled it and the first thing I noticed is that the led on the teensy board was off. I tried to use it and the virtuino part of the code was working but the audio wasn't.
There is something I am mistaking, but I don't understand what is it. If anyone has any idea and is available to share it, I would appreciate that. If you need more info about the problem please ask me. Thanks you all for your help.
Moreover, I would like to know also if it's possible to power teensy using a power bank with 5V. Thanks again.
The first is a simple Passthrough for the audio shield
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioInputI2S i2s1; //xy=227,171
AudioOutputI2S i2s2; //xy=570,177
AudioConnection patchCord1(i2s1, 0, i2s2, 0);
AudioConnection patchCord2(i2s1, 1, i2s2, 1);
AudioControlSGTL5000 sgtl5000_1; //xy=558,268
// GUItool: end automatically generated code
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
sgtl5000_1.enable();
sgtl5000_1.volume(0.5);
sgtl5000_1.unmuteHeadphone();
sgtl5000_1.inputSelect(AUDIO_INPUT_LINEIN);
AudioMemory(60);
}
void loop() {
// put your main code here, to run repeatedly:
}
I compile it and it works well.
the second script aims to verify whether the virtuino app talks to the teensy, so I wrote this second code
Code:
#include "VirtuinoBluetooth.h"
#include <SoftwareSerial.h>
SoftwareSerial bluetoothSerial = SoftwareSerial(9,10);
VirtuinoBluetooth virtuino(bluetoothSerial);
int value;
void setup() {
// put your setup code here, to run once:
virtuino.DEBUG=true;
Serial.begin(9600);
bluetoothSerial.begin(9600);
}
void loop() {
virtuino.run();
value=virtuino.vMemoryRead(30);
Serial.println(value);
}
I connect the VGG to the Vin (since hc-05 require 3.6-6V, using the usb port to power teensy), in the app I added a virtual switch and it works well. I also tried to use differents rx&tx pin, 31 and 32, but it doesn't work, if someone know the reason why I'd like to know, but it's not so important.
Finally I merged all together to try if I could control an audio project using the virtuino app. So I wrote this code:
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
#include "VirtuinoBluetooth.h"
#include <SoftwareSerial.h>
SoftwareSerial bluetoothSerial = SoftwareSerial(9,10);
VirtuinoBluetooth virtuino(bluetoothSerial);
int value;
// GUItool: begin automatically generated code
AudioInputI2S i2s1; //xy=227,171
AudioOutputI2S i2s2; //xy=570,177
AudioConnection patchCord1(i2s1, 0, i2s2, 0);
AudioConnection patchCord2(i2s1, 1, i2s2, 1);
AudioControlSGTL5000 sgtl5000_1; //xy=558,268
// GUItool: end automatically generated code
void setup() {
virtuino.DEBUG=true;
Serial.begin(9600);
bluetoothSerial.begin(9600);
sgtl5000_1.enable();
sgtl5000_1.volume(0.5);
sgtl5000_1.unmuteHeadphone();
sgtl5000_1.inputSelect(AUDIO_INPUT_LINEIN);
AudioMemory(60);
}
void loop() {
virtuino.run();
value=virtuino.vMemoryRead(30);
Serial.println(value);
}
There is something I am mistaking, but I don't understand what is it. If anyone has any idea and is available to share it, I would appreciate that. If you need more info about the problem please ask me. Thanks you all for your help.
Moreover, I would like to know also if it's possible to power teensy using a power bank with 5V. Thanks again.