Pages: 1 [2]   Go Down
Author Topic: Auduino Fix + Delay  (Read 3179 times)
0 Members and 1 Guest are viewing this topic.
Collegno, Turin
Offline Offline
Newbie
*
Karma: 0
Posts: 37
Arduino lovers
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
bDelay = true;


or just this part

Code:
bDelay = !bDelay;


thx for helping me Duane sorry for my dumb questions... smiley
Logged

Dubai, UAE
Offline Offline
Edison Member
*
Karma: 22
Posts: 1675
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged


Collegno, Turin
Offline Offline
Newbie
*
Karma: 0
Posts: 37
Arduino lovers
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Collegno, Turin
Offline Offline
Newbie
*
Karma: 0
Posts: 37
Arduino lovers
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok the amp circuit works!

Thanks Duane for your tutorial smiley-wink

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

Dubai, UAE
Offline Offline
Edison Member
*
Karma: 22
Posts: 1675
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged


Collegno, Turin
Offline Offline
Newbie
*
Karma: 0
Posts: 37
Arduino lovers
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

oh shit I understand now!!!  smiley-money

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
Logged

Dubai, UAE
Offline Offline
Edison Member
*
Karma: 22
Posts: 1675
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged


Dubai, UAE
Offline Offline
Edison Member
*
Karma: 22
Posts: 1675
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged


Pages: 1 [2]   Go Up
Jump to: