Show Posts
Pages: 1 2 [3] 4 5 6
31  Using Arduino / Project Guidance / Re: TMRPCM WAV file player noisy sound before and after playing a wav file on: July 30, 2013, 06:31:52 pm
Still have annoying pops and cracks, mostly at the end and beginning of each file.

Well there is one main caveat, being that if you play a wav file of one sample rate, followed by a file of another sample rate, there will still be a small pop heard on the transition. This could be fixed, but for the effort and extra lines of code required, I am not sure if worthwhile.

If you are getting pops and cracks during playback, then that is something altogether different. Try using the quality(0); command or a lower sample rate to see if that makes a difference. That usually indicates buffer underruns are occurring.

If the above does not help, does it do it when starting/stopping the same file? And does it still pop when you pause/unpause?

Volume up still seems to work but volume down results in a loud buzzing sound when I play the second .WAV file for some reason.

I would guess that this would be related to sample rate also. Is the second file encoded at a sample rate higher than 16khz? I remember having this same issue, but it was with a fairly high sample rate and a different version of the library. Are you sure you copied over the old files when you updated the library? Otherwise, please email the wav file to tmrh20 at gmail and I will try to recreate the issue.

32  Using Arduino / Project Guidance / Re: TMRPCM WAV file player noisy sound before and after playing a wav file on: July 27, 2013, 10:29:57 pm

This is now fixed in the latest update: https://github.com/TMRh20/TMRpcm/archive/master.zip
It took me a while to figure it out, but found it was due to the difference between the last sample and the first sample in the new audio, so created a ramp to handle the transition.

The code posted above was supposed to create a ramp from 0 to 150, but only helped a bit for playback.

re:
Code:
for(int i=0; i<buffSize; i++){ buffer[0][i] = i; }
for(int i=0; i<buffSize; i++){ buffer[1][i] = i+buffSize;  }

Now it uses the last timer value compared against the first new value and creates a transition.

There is still a pop on the first initialization, but after that, it should be gone.
33  Using Arduino / Audio / Re: Audio not playing within new code. on: July 09, 2013, 06:57:39 pm
Hmmm its still giving me some trouble.  smiley-confuse No audio yet. It seems like the code is fine but the program will not "pause" and play   tmrpcm.play("birds.wav"); or any of the others because it only plays the first millisecond or so. Is this a valid hypothesis or am I crazy?

Maybe, but I could be crazy too, and you can't let crazy people decide whether you're crazy or not, can you?

The audio library is designed to run asynchronously, so the code will still execute while the music plays. It should keep playing however, unless you specifically stop the playback.

To "pause' the main loop, you can use
Code:
 

tmrpcm.play("thunder.wav");
while(tmrpcm.isPlaying()){}

 

The IR library works fine with my Arduino Mega if the sounds are encoded at 8-11khz. Anything higher causes problems with the playback due to the excessive processing load. I don't have any other type of Arduino to test on at the moment but should work similarly on Uno, Nano, etc.
34  Using Arduino / Audio / Re: WAV File from SD Card on: July 06, 2013, 01:53:33 pm
If the audio comes out like static, the most likely cause is some sort of file corruption on the SD card, or a problem with the file itself. If not, then make sure the wav file is encoded correctly (16khz, 8bit, mono). Also make sure you have the most recent version: https://github.com/TMRh20/TMRpcm/archive/master.zip
35  Using Arduino / Programming Questions / Re: Setting up interrupts in a library ... problems with attachInterrupt() on: March 25, 2013, 10:00:46 pm
No matter how you look at it, you are pretty much stuck with globals if using interrupts.
36  Using Arduino / Programming Questions / Re: Setting up interrupts in a library ... problems with attachInterrupt() on: March 25, 2013, 07:25:16 pm
It should work in a library, but you need to do it a bit differently in a library when callign the function from an interrupt:

Just like you had it:
Code:
attachInterrupt(0, _switchHOME, FALLING);

But change this:

Code:
void Easy_Motor::_switchHOME ()

to this:

Code:
void _switchHOME ()

and you can declare it outside your class (globally) in Easy_Motor.h
37  Using Arduino / Project Guidance / Re: Quadcopter/ Capstone project on: March 20, 2013, 07:11:28 pm

For the coding, take a look at MultiWii.com if you want an example of some solid open-source quadcopter coding for Arduino. Many quality commercial boards run this code, but it will work on a stock Arduino board with some sensor modules as well.

Not sure what you mean exactly by "internet/rc" control, but there are many options for wireless control, so it depends on what you plan to do with it. You can use a standard RC transmitter/receiver or even go totally custom and use a digital tranceiver, so you can communicate directly with other digital devices. (PC, Arduino, etc)
38  Using Arduino / Project Guidance / Re: running bitlash scripts from the arduino on the arduino without serial input on: March 20, 2013, 06:25:23 pm
You may want to take a look at the bitlash API as well:

https://github.com/billroy/bitlash/wiki/api
39  Using Arduino / Project Guidance / Re: multiple software serial inputs on: March 17, 2013, 10:28:46 pm
Since it looks like you only write to the LCD and you only read from the RFID reader, you could use a single software serial port for both of them with TX to LCD and RX from RFID reader.. I think.
40  Using Arduino / Programming Questions / Re: Errors with Timer3 library on: March 16, 2013, 04:04:09 pm
If you are using a rainbowduino board, it is based on Atmega 328 which only has a single 16-bit timer (Timer1).

The Timer3 library is made for boards like the Mega2560 which has four 16-bit timers.

That should compile fine if you choose a Mega board.
41  Using Arduino / Project Guidance / Re: How to decode this on: March 08, 2013, 07:09:06 pm
Hmmm.. I just did a bit of a writeup on decoding digital signals using the Input Capture function on Arduino the other day:

http://tmrh20.blogspot.com/2013/02/digital-data-encoding-manchester.html


The sketch there could be adapted to decode this type of signal.

42  Using Arduino / Project Guidance / Re: Arduino-powered bike computer on: March 08, 2013, 06:44:38 pm
Uuuhhhhh ... Yup.

Thats why I suggest using an interrupt:  http://arduino.cc/en/Reference/AttachInterrupt

The Arduino will be able to catch very short triggers, and interrupts are about the most reliable way of catching short signals or pulses. Instead of having to check constantly if a pin is HIGH/LOW, the Arduino continually monitors it for you, and interrupts the main loop when the state of the pin changes. This leaves the CPU free to do other things in between signals.
43  Using Arduino / Project Guidance / Re: Arduino-powered bike computer on: March 08, 2013, 06:28:06 pm
Yeah, it can handle counting many thousands of times per second, so handling inputs from sensors on a bike should be no problem, especially if you use interrupts, so it only does work when there is a change of state.

44  Using Arduino / Project Guidance / Re: Arduino-powered bike computer on: March 08, 2013, 06:21:44 pm
Totally possible on one Arduino, and if speed is a concern, just make sure all of your modules support I2c or SPI, and it will handle it.

You can use interrupts for the hall-effect sensors, so the Arduino doesn't have to keep checking the state, and it will handle it easily enough. You woul have install jets on your bike before worry about overrunning its capabilities.

The amount of sensors is limited by what type of sensor etc, so is kind of impossible to give you a max number, but it can handle multiple I2C devices, so you could run the GPS, SD card and LCD all off I2C.

45  Using Arduino / Project Guidance / Re: quadcopter using arduino mega on: March 08, 2013, 06:07:06 pm
You are probably going to want to check out MultiWii:

http://www.multiwii.com/
http://www.multiwii.com/connecting-elements

I also recently documented a very simple Quad based on an Arduino Mega and a few modules:

http://tmrh20.blogspot.com/2013/01/quadcopter-current-summary-docs-and.html


Basically, you usually want gyro, accellerometer, compass, and barometer sensors which you can get in a single module, then you just need something for wireless control, whether you buy a controller or build one. I used an old XBox controller.
Pages: 1 2 [3] 4 5 6