Go Down

Topic: ATTiny85 tone() core? (Read 5905 times) previous topic - next topic

nickelbake95

This
http://code.google.com/p/arduino-tiny/downloads/detail?name=arduino-tiny-0022-0008.zip&can=2&q=
doesn't seem to work. Nor does this: http://code.google.com/p/arduino-tiny/
Are they just outdated, and if so can I just revert back to an older version of arduino IDE?

Jack Christensen

I'm using the latter with v1.0.3, what is the specific problem? ... "doesn't seem to work" is a bit broad.

nickelbake95

The entire ATTiny works fine. I can blink an LED. But when I use tone() with a speaker, nothing happens. I'll try it with 1.0.3 now and see if that makes a difference. (I've been using 1.0.1 up until now)

nickelbake95

So I re-installed arduino as 1.0.3. Also re-installed the core you used. Built the circuit correctly. Made sure that a normal LED sketch works. (It does.) The tone() still won't work.

Coding Badly


Jack Christensen

Post your code, I'll have a look and/or give it a try.

nickelbake95

I doubt it's actually the code, seeing as how it's just a simple test:
Code: [Select]
void setup() {
}
void loop() {
  tone(3, 2000, 500);
  delay(500);
  tone(3, 3500, 500);
  delay(500);
}

I'm thinking something is different about the core, but I followed the readme.txt exactly... :/

Jack Christensen


Coding Badly


Pin 3 is on the left side of the processor one down from the top.  What's connected to it?

nickelbake95

The speaker (which I know works) connected to ground.

Coding Badly

Quote
...with a speaker...


An 8 ohm speaker?

nickelbake95

No, it's a buzzer. I think it's called a piezzo buzzer. And I know it works with the tone() function on the arduino.

Jack Christensen

Hmm. And an LED will blink on the same pin?

nickelbake95


Jack Christensen

Load the blink sketch, blink an LED on pin 3, say 100ms on and 100ms off. Once that is working, add the piezo to the circuit, from pin 3 to ground (through a small resistor, 100 ohms or so is best if you have one.)

What do you hear from the piezo?

Go Up