Pro Trinket Driving FX Mini Sound Board

Adafruit's tiny microcontroller platform. Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
sabotkill
 
Posts: 2
Joined: Mon Mar 25, 2019 8:42 am

Pro Trinket Driving FX Mini Sound Board

Post by sabotkill »

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,

User avatar
XRAD
 
Posts: 754
Joined: Sat Nov 19, 2016 3:28 pm

Re: Pro Trinket Driving FX Mini Sound Board

Post by XRAD »

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

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

pinMode(PINX, OUTPUT);
All transistor emitters to ground, POS to base leg from trinket, and each collector leg to the FXmini channel as needed.
986c98eee00bff9ffa4b56da03411fb4_preview_featured.JPG
986c98eee00bff9ffa4b56da03411fb4_preview_featured.JPG (65.06 KiB) Viewed 230 times


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......

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

Re: Pro Trinket Driving FX Mini Sound Board

Post by sabotkill »

Thank you, I'll give this a go.

User avatar
XRAD
 
Posts: 754
Joined: Sat Nov 19, 2016 3:28 pm

Re: Pro Trinket Driving FX Mini Sound Board

Post by XRAD »

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.....

User avatar
adafruit_support_carter
 
Posts: 29483
Joined: Tue Nov 29, 2016 2:45 pm

Re: Pro Trinket Driving FX Mini Sound Board

Post by adafruit_support_carter »

@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

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/

User avatar
XRAD
 
Posts: 754
Joined: Sat Nov 19, 2016 3:28 pm

Re: Pro Trinket Driving FX Mini Sound Board

Post by XRAD »

THX Carter! I learn something every day here. It takes a minimum of 100ms to trigger the FXsoundboard using:

Code: Select all

//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

User avatar
adafruit_support_carter
 
Posts: 29483
Joined: Tue Nov 29, 2016 2:45 pm

Re: Pro Trinket Driving FX Mini Sound Board

Post by adafruit_support_carter »

Good point about the delay.

Locked
Please be positive and constructive with your questions and comments.

Return to “Trinket ATTiny, Trinket M0”