Hello everybody,
This is my first message in this forum. Sorry for my english.
I have a problem, but first, i use:
- Ubuntu 18.04
- Teensy 3.6
- ESC Tsky 120A (with DC engine)
- Ampli 2x4W (with speaker)
Libraries:
- Servo
- ESC
-
When I only use the ESC, the engine works.
When I only use the Audio (in DAC0), the music works.
If I use two WAVs in mixer (both in DAC0), the 2 music works together.
But when I try to operate both at the same time, only the audio works.
If I commented the lines:
then the ESC works
Any ideas?
Thank you very much.
This is my first message in this forum. Sorry for my english.
I have a problem, but first, i use:
- Ubuntu 18.04
- Teensy 3.6
- ESC Tsky 120A (with DC engine)
- Ampli 2x4W (with speaker)
Libraries:
- Servo
- ESC
-
When I only use the ESC, the engine works.
When I only use the Audio (in DAC0), the music works.
If I use two WAVs in mixer (both in DAC0), the 2 music works together.
Code:
#include <Audio.h>
#include <Wire.h>
#include <SD.h>
#include <SerialFlash.h>
#include <Servo.h> // Librería para controlar el ESC y los servos
#include "ESC.h"
ESC esc;
// GUItool: begin automatically generated code
AudioPlaySdWav canal1; //xy=262,142
AudioPlaySdWav canal2; //xy=262,198
AudioMixer4 mezclador; //xy=544,256
AudioOutputAnalogStereo dacs1; //xy=668,144
AudioConnection patchCord1(canal1, 0, mezclador, 0);
AudioConnection patchCord2(canal2, 0, mezclador, 1);
AudioConnection patchCord3(mezclador, 0, dacs1, 0);
// GUItool: end automatically generated code
#define SDCARD_CS2_PIN 43
#define SDCARD_MISI2_PIN 44
#define SDCARD_MISO2_PIN 45
#define SDCARD_SCK2_PIN 46
void setup()
{
esc.attach(38);
}
void loop()
{
for (int i=400; i<800; i=i+1)
{esc.setSpeed(i);
delay(10);}
}
But when I try to operate both at the same time, only the audio works.
If I commented the lines:
Code:
AudioPlaySdWav canal1; //xy=262,142
AudioPlaySdWav canal2; //xy=262,198
AudioMixer4 mezclador; //xy=544,256
AudioOutputAnalogStereo dacs1; //xy=668,144
AudioConnection patchCord1(canal1, 0, mezclador, 0);
AudioConnection patchCord2(canal2, 0, mezclador, 1);
AudioConnection patchCord3(mezclador, 0, dacs1, 0);
then the ESC works
Any ideas?
Thank you very much.