ATTiny85 tone() core?

nickelbake95:
The tone() still won't work.

Wanna bet?

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

I doubt it's actually the code, seeing as how it's just a simple test:

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... :confused:

Works fine here.

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

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

...with a speaker...

An 8 ohm speaker?

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.

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

Yes.

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?

A quiet click every 200ms.

The core I'm downloading is called "arduino-tiny-0100-0015" if that makes a difference. (Found it from the second link at the beginning of this post)

Well I thought it should be a click every 100ms but no matter :wink:

I think we've ruled out all the hardware. You've re-installed the Arduino IDE v1.0.3 and the current Arduino-tiny core. I'm out of ideas at the moment...

nickelbake95:
The core I'm downloading is called "arduino-tiny-0100-0015" if that makes a difference. (Found it from the second link at the beginning of this post)

Yep, actually, I had arduino-tiny-0100-0014, so I installed 0100-0015, but no difference.

Well, I'm going to go to bed. Maybe tomorrow I'll think of another variable we can test. If so, I'll post here about it. In the mean time, thanks for all the help.

Sounds like a plan. I'll track this thread, will be interested what you might find and if any light bulbs (or LEDs) go on here I'll let you know too.

Just to rule out the piezo itself, since you have it already connected on one of the ATTiny PWM pins, can you get a sound from it using analogWrite, as an example:

analogWrite(3, 100);

Geoff

If you've verified you're running sketches ok, and verified you can blink an LED on this pin, it's time to check whether the buzzer polarity might be a factor, whether the buzzer is damaged, and to try a real 8 ohm speaker (with an additional small resistor). Another reasonable step would be to try your buzzer with another Arduino.

good luck!

Just to rule out the piezo itself, since you have it already connected on one of the ATTiny PWM pins, can you get a sound from it using analogWrite

AnalogWrite does not produce a sound.

it's time to check whether the buzzer polarity might be a factor

It's a non polar buzzer, which works no problem with the arduino itself.

Despite these not being the problem, I found the solution: there was an older ATTiny core that I never removed. It was overriding the new core with the tone() function. Once I removed the older core, the new one took effect and now the project works fine.
Thanks to everyone for their help!