SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By sspence65
#184962
I built the project at https://learn.sparkfun.com/tutorials/si ... simon-says

All that happens is the blue light double flashes every second or so. I wrote a sketch that reads a switch and triggers the correct LED, so I know the switches and LED's are wired correctly and working. What gives? I have a working piezo (used the sample tone sketch) but get no sound from this project.
By Valen
#184966
You'll have to show pictures of your actual setup and the code you made yourself. Just like Facebook right now, my magic glass ball is out-of-order.
By Valen
#184969
I said ... your actual setup. Not how somebody else says it should be. Even with those Fritzing diagrams mistakes can be made in connecting things.

Have you checked the polarity of the leds?
By sspence65
#184970
Did I not say that I have the lights blinking and I'm reading the switches? Pretty sure I did. It's the SIK Simon sketch that does not work. Have you looked at it?
By Valen
#184973
I have certainly looked at it. And I'm pretty sure many others too. (Though that is not a guarantee of a faultless code on that webpage) I can find no obvious fault in it. But it is complex and I may have missed it.

I can find no reason in the code why only the blue led should flash twice short in a second. The others should flash also (in rythm) if it stays in the attractMode function. So that would suggest a hardware issue. If it did get out out of the attractMode (by a deliberate or fake switch toggle detection) it should flash all leds at the same time for a full second. After which it should play the game. If that does not reflect what you are seeing then I wonder if the Arduino Uno (or was it the Redboard?) contains the program that you expect it to be.

You may have used code to test if the leds, switches and piezo worked. But not knowing how you did it, I cannot compare it to how this program uses them. (I don't know which "sample tone sketch" you are referring to) If something is not working and people need help figuring it out, I consider everything suspect. You may have accidentally dislodged a wire in the mean time. Or touched another part with one causing a short some how. Never underestimate Murphy's Law. Double check always
By sspence65
#184974
Here is my LED test sketch.

I similarly tested the switches. all parts are soldered to a protoboard. There are no wiring errors.

int ledG = 3;
int ledY = 5;
int ledR = 10;
int ledB = 13;

// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(ledR, OUTPUT);
pinMode(ledG, OUTPUT);
pinMode(ledB, OUTPUT);
pinMode(ledY, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
digitalWrite(ledR, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000);
digitalWrite(ledG, HIGH);
delay(1000);
digitalWrite(ledB, HIGH);
delay(1000);
digitalWrite(ledY, HIGH);
delay(1000);



digitalWrite(ledR, LOW); // turn the LED off by making the voltage LOW
delay(1000);
digitalWrite(ledG, LOW);
delay(1000);
digitalWrite(ledB, LOW);
delay(1000);
digitalWrite(ledY, LOW);
delay(1000); // wait for a second
}
By Valen
#184986
In what pattern does the above code make the leds turn on? Please describe accurately.

P.s. It doesn't have to be a wiring error. There may also be a solder-blob connecting wires/pins or traces that should not be connected and creating a short somehow.