0

I've used the piezo on other projects with no problem, but for some reason this project isn't working out so hot.

Here's a photo of my current set up.

Uno layout

Here's the basic code that I presumed would make a sound, but no such luck.

void setup() {}

void loop() { 
  tone(12,260);
  delay(10);
}

Not sure where to begin debugging this...

3
  • I can't see any wires connecting to the Piezo.
    – Majenko
    Mar 6 '16 at 20:52
  • @Majenko 2 and 6 on the breadboard connect to the piezo.
    – Shpigford
    Mar 6 '16 at 21:03
  • 1
    No they're not - they're on the wrong side of the board.
    – Majenko
    Mar 6 '16 at 21:03
3

As Majenko pointed out, the wires are not connected to the piezo. By moving the piezo to the correct rails on the other side of the board, the circuit would be completed and the piezo should work.

Edit: Building on Nick Gammon's comment, the rows of each side of a breadboard are not connected (to allow DIP packages).

3
  • 1
    To explain a bit more: for each number abcde are interconnected, and so are fghij, but those pairs are not connected.
    – Arjan
    Mar 6 '16 at 21:17
  • 1
    And the reason for this is: You can plug a chip into the middle of the board, one set of legs is on one side, and you can plug your breadboard wires into them, and the other set of legs is on the other side. If the sides were connected together, the chip wouldn't work.
    – Nick Gammon
    Mar 6 '16 at 21:22
  • Ah! Perfect. That did the trick. Thanks so much!
    – Shpigford
    Mar 6 '16 at 21:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.