Let's say I have an SD card shield, and I put an SD card with a sound on it into the shield. How do I program the Arduino to play that sound by it's name?
I want to try simple wireless communication with IR emmiting and recieving diodes.
I want to use two arduino board.
the code for the emitter will be something like a blink with a 1mS delay. What is the code for the other one? I mean,
if that pin is HIGH, than delay 1mS, than LOW and another delay.
how do I write that code?
on the normal 'if' I have () to put my condition, what if it's a big condition?
Thanks for your patients, time and forgivness for my spelling mystakes and sorry for digging!
Two things with the SDcard: First you need a library to read the SD filesystem, there are several libraries available, but one already present in the Arduino distribution called "SD". Secondly you need to be able to decode the file format and pass it to some sound outputing device - this could be beyond the Arduino (don't expect to get a high data rate from the SD card, nor to be able to buffer audio in RAM given the tiny amount of RAM in the Arduino). Check out the Audio section of the forum for more approaches.
For IR communication sending is easy, its just flashing an LED, but receiving takes amplification and demodulating/decoding, which is a more complex area - some sort of amplifier circuit may be necessary to get the sensitivity you want - what sensitivity do you want?
I don't think were on the same page with the wireless communication.
I am going to use a light recieving diode, with only 2 legs, not an IR reciever, the diode shorts when IR light is near it and I connect it to the 5V to give a HIGH or LOW standart.
What about the code?
I need to right the statment that if it gets HIGH, delay (1), LOW, delay (1), HIGH, delay (1), LOW, delay (1)
than it triggers an LED on pin 13 or something, and that big IF won't go in the brackets ().
if it gets HIGH, delay (1), LOW, delay (1), HIGH, delay (1), LOW, delay (1)
What does this mean? Are you trying to say that if a pin goes HIGH, stays HIGH for one millisecond, goes LOW, stays low for one millisecond, and then repeats that process, that you want to do something?
Exactly. IF that pin (let's say digital pin 9) goes HIGH, stays HIGH for 1 millisecond, then goes LOW, stays LOW for 1 millisecond and repeat that process one more time, THEN it will make pin 13 HIGH.
pin 9 will be connected to an infra red light receiving diode which will give a HIGH every time it gets infra red light.
I'm gonna take another Arduino with an IR LED on it and make it do the actions above.