Go Down

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

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.

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)

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.

Jack Christensen

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:
Code: [Select]
void setup() {
void loop() {
  tone(3, 2000, 500);
  tone(3, 3500, 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?

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

Coding Badly

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

Jack Christensen

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

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

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131