Go Down

Topic: Auduino Fix + Delay (Read 3835 times) previous topic - next topic

Giò LFZ

Quote
Hi,
   The way the delay switch on/off is implemented is ugly - everyone has buttons, not everyone has a switch so I wrote the code as a very simple button/toggle switch.

To force delay, replace this section of code

Code:
// if the delay button is pressed, toggle delay
  if(0 == digitalRead(DELAY_BUTTON))
  {
    bDelay = !bDelay;
    // keeping it simple,
    delay(500);
  }

with

Code:
bDelay = true;




I have a doubt....


I must change all the section that you indicate with
Code: [Select]
bDelay = true;



or just this part

Code: [Select]
bDelay = !bDelay;


thx for helping me Duane sorry for my dumb questions... :)

DuaneB

The section of code is a bit of a hack to use a push button as a toggle switch - its ugly and does not work that well, I will change it soon.

In the meantime to force delay on, replace the whole section with bDelay = true;

Duane B
Read this
http://rcarduino.blogspot.com/2012/04/servo-problems-with-arduino-part-1.html
then watch this
http://rcarduino.blogspot.com/2012/04/servo-problems-part-2-demonstration.html

Rcarduino.blogspot.com

Giò LFZ

Ok now I can feel the delay!!!!

want to show me how I can merge this two scketches now????    :smiley-mr-green:


I'm tryng to build even the LM386-N4 circuit amp, but I can't figure out how to power the IC... in the schematics you say its better to separate the power...

but how could do this? For my Auduino I use an arduino mega powered via usb.... I prefer not to use a battery... have you some advice for this?

Its a stupid idea try to power the circuit with the  arduino mega??

G


Giò LFZ

Ok the amp circuit works!

Thanks Duane for your tutorial ;)

I don't know why but the volume pot doesnt seems to work in the right way... is like a switch, you have to turn it until he reach a sort of treshold.... after that limit the volume start to pump...

DuaneB

Hi,

The pot is on the input side, its there to adjust the level of the input signal, not the output volume.

You do not hear much difference with square waves but with a sine wave you can hear the amp get overdriven as you adjust the input level, it can add an extra bit of colour to the sound.

Do you want volume ? I usually find the default volume is about right.

Duane B

Read this
http://rcarduino.blogspot.com/2012/04/servo-problems-with-arduino-part-1.html
then watch this
http://rcarduino.blogspot.com/2012/04/servo-problems-part-2-demonstration.html

Rcarduino.blogspot.com

Giò LFZ

oh shit I understand now!!!  $)

I've notice a sort of colored sound....  yes the volume works good but iI would like to have less noise signal.... before solder all together I liked the filter "cut off"...


have you find a solution for the delay??? I would like to help you but I'm very bad in coding  :smiley-sad-blue:

DuaneB

Hi,
   Two options for a nice hardware solution are -

1) A toggle switch to turn delay on/off

2) A potentiometer to adjust the delay buffer size anywhere from 0 for no delay to fractions of a second for a deep delay.

For now I will recommend 1) toggle switch, I will update the code to use this and the post to recommend this.

Duane B
Read this
http://rcarduino.blogspot.com/2012/04/servo-problems-with-arduino-part-1.html
then watch this
http://rcarduino.blogspot.com/2012/04/servo-problems-part-2-demonstration.html

Rcarduino.blogspot.com

DuaneB

Hi,
   Very simple update to the code is now in place here -

http://rcarduino.blogspot.com/2012/11/auduino-with-delay.html

It assumes a toggle switch is connected between the DELAY_BUTTON pin and ground and that a 10K pull up resistor is connected from 5V to the DELAY_BUTTON pin - your typical button with a pull up circuit except we are using a toggle switch inplace of a button.

I am making slow progress with a ribbon synth that uses and adaptation of the Auduino synth engine, hope to be able to post something soon.

Duane B

rcarduino.blogspot.com
Read this
http://rcarduino.blogspot.com/2012/04/servo-problems-with-arduino-part-1.html
then watch this
http://rcarduino.blogspot.com/2012/04/servo-problems-part-2-demonstration.html

Rcarduino.blogspot.com

Go Up