0

Pro Trinket Driving FX Mini Sound Board
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Pro Trinket Driving FX Mini Sound Board

by sabotkill on Mon Mar 25, 2019 11:40 am

Hello,

For my project, I am wanting to trigger pins on a FX Mini Sound Board using a Pro Trinket. The FX pins are triggered when they are pulled "low" to ground. My question is, when i turn on a Trinket output, how can do I get the output to behave as a low signal to the FX. That is to say, make the output behave like a ground.

I understand that to program an output, one uses the DigitalWrite command, either High or Low. Example below:

digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(3000); // wait for 3 seconds
digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW
delay(3000); // wait for 3 seconds

Does this method work? That is to say, I program the output to stay HIGH until I a am ready to trigger the FX sound board, then I program the output to LOW for as long as I want the sound to trigger and return it back to HIGH when I want the sound to end.

Thank you,

sabotkill
 
Posts: 2
Joined: Mon Mar 25, 2019 8:42 am

Re: Pro Trinket Driving FX Mini Sound Board

by XRAD on Tue Mar 26, 2019 9:32 am

I could be wrong, but to set a GROUND trigger for the FXMini, you need a 'PULL_UP' resistor either built into the processor or added externally, and the code line:

Code: Select all | TOGGLE FULL SIZE
pinMode(PINX, INPUT_PULLUP);//if internal resistor available
//or
pinMode(PINX, INPUT);//if external pullup resistor

You would have to read up on the ATMega chip. Not sure if this is possible on this processor.

Otherwise, it is very easy to add an external transistor , such as the 2n3904 transistor, for each channel (8max on FXMini, so you need max 8 pins from trinket). This works great. +V out from trinket to trigger the FXMini. FXMini's are great little sound boards and easy to use! You should not need to wait for 3 seconds either. Usually 20-30 milisecs enough to trigger the FXMini to play a single track. without interrupts, that track has to finish playing before the next track can play, even if it is triggered. There are many ways to play the tracks on the FXMini. For example, if you want a sound to loop(a basic loop w/out track play interrupt), keep the PINX HIGH, and then set to LOW just before triggering another track PINY HIGH...etc...

just use this line and run + OUT to the transistor base:
Code: Select all | TOGGLE FULL SIZE
pinMode(PINX, OUTPUT);


All transistor emitters to ground, POS to base leg from trinket, and each collector leg to the FXmini channel as needed.


as a side note, I did not need to add the transistors and resistors to the teensy in the pic above, as it has built in pullup and pulldown transistor circuits......

XRAD
 
Posts: 532
Joined: Sat Nov 19, 2016 3:28 pm

Re: Pro Trinket Driving FX Mini Sound Board

by sabotkill on Wed Mar 27, 2019 3:42 pm

Thank you, I'll give this a go.

sabotkill
 
Posts: 2
Joined: Mon Mar 25, 2019 8:42 am

Re: Pro Trinket Driving FX Mini Sound Board

by XRAD on Thu Apr 04, 2019 8:11 pm

Wanted to report my error. Not for the Trinket Pro necessarily. Stated above that you can use INPUT_PULLUP to set some processors to negative input on the respective pin. That is only for digitalRead, not for grounding a ground! (which is a pain because it would be very helpful) digitalRead will show a 0 or 1 depending on if it sees a ground. Alternatively, INPUT_PULLDOWN for seeing a positive V then will trigger a 0 or 1.

Sooooo, you will have to use the transistors to actually bridge the ground and activate the FX sound board. easy to do and works great off the Trinket digitalWrite(PIN,HIGH). I did not need any delay() to trigger the FX soundboard.....

XRAD
 
Posts: 532
Joined: Sat Nov 19, 2016 3:28 pm

Re: Pro Trinket Driving FX Mini Sound Board

by adafruit_support_carter on Fri Apr 05, 2019 9:23 pm

@sabotkill You should be able to do as in your first post. Just wire the Pro Trinket pins to the FX Mini pins. Set them as outputs. Keep them HIGH. Setting to LOW is equivalent to shorting them to GND with a button. And setting HIGH is like letting go of the button.

You have the correct general commands here:
Code: Select all | TOGGLE FULL SIZE
digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(3000); // wait for 3 seconds
digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW
delay(3000); // wait for 3 seconds

but you will also need to use setMode() in the setup() to set the pins to output:
https://www.arduino.cc/reference/en/lan ... o/pinmode/

adafruit_support_carter
 
Posts: 13191
Joined: Tue Nov 29, 2016 2:45 pm

Re: Pro Trinket Driving FX Mini Sound Board

by XRAD on Sat Apr 06, 2019 5:28 pm

THX Carter! I learn something every day here. It takes a minimum of 100ms to trigger the FXsoundboard using:
Code: Select all | TOGGLE FULL SIZE
//to  triggers the FX soundboard
#define triggerPin    3 //pin to soundboard
//FX ground and Trinket grounds tied together

void setup() {
  pinMode(triggerPin , OUTPUT);
}

void loop() {
  digitalWrite(triggerPin , LOW);
  delay(100);
  digitalWrite(triggerPin , HIGH);
  delay(5000);
}



I had 'no delay' in one of my codes because FXsoundboard was always being triggered in one of several map/cases

XRAD
 
Posts: 532
Joined: Sat Nov 19, 2016 3:28 pm

Re: Pro Trinket Driving FX Mini Sound Board

by adafruit_support_carter on Mon Apr 08, 2019 3:13 pm

Good point about the delay.

adafruit_support_carter
 
Posts: 13191
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.