Attiny85 tone issue

I am using the Arduino Duemilanove as an ISP to program an ATtiny85. I simply want the 85 to play a tone however when I upload my sketch (a simple tone test), I get the error message "tone is not defined". Is there a different library I need to use?

Give this core a try...

Doesn't seem to support tone either.

I know for a fact that it does. Post your Sketch.

This is the simplest version of my code. I get the error message "tone not declared in this scope"

const int buttonPin = 3;     // the number of the pushbutton pin
int buttonState = 0;

void setup() {   

  pinMode(buttonPin, INPUT); 
  pinMode(0, OUTPUT);
  pinMode(4, OUTPUT);


void loop() {
   buttonState = digitalRead(buttonPin);
  if (buttonState == HIGH) 
  tone(4, 2000, 80);            //beep
  delay(80);                       // delay
  digitalWrite(0, HIGH);     // set the LED on
  delay(80);                      // delay
  digitalWrite(0, LOW);     // set the LED off
  delay(80);                      // delay

    else {

Which board do you have selected?

Does the Sketch compile if you select "Arduino Uno"?

I'm using the Duemilanove and yes it compiles fine with the arduino selected but will not work when the ATtiny85 is selected.

but will not work when the ATtiny85 is selected.

In order for me to help you, you have to provide answers to my questions. In case my question was not clear, I will try wording it a bit differently...

Precisely which ATtiny board do you have selected? Please reply with the exact wording of the menu item.

ATtiny85 (w/ Arduino as ISP)

That is not a board from the core I recommended...

So I will refer you here for the solution...

I'm not exactly sure how to download this core.. Also, when the core is downloaded, will it be placed in my hardware folder?

I'm not exactly sure how to download this core..

Navigate to the site. Navigate to the Downloads tab. Click the first link.

Also, when the core is downloaded, will it be placed in my hardware folder?

readme.txt It's in the download package. Open it. Read it. Follow the instructions.

Thank you for your patience, and moments of sarcasm ;). My sketches are running smoothly!

My sketches compiled fine but when uploading them to the ATtiny85 I got a much different error message and the uploading process never finished. My process is to run the Arduino isp code on the Duemilanove board and then switch to the Attiny85 8mhz board and upload my light/tone sketch.

Is there a different process I am not using?

In the "boards.txt" file there are entries similar to this one...


If the entry is missing or incorrect, that error message is produced. For the Arduino ISP, the entries should be altered to something like this...


I found this: (w/ Arduino as ISP)

Still the same error message

ATtiny85 (w/ Arduino as ISP) that the board you are using? That you have selected when you upload?

No sorry I copied the wrong one, I need to be using this one:


I added this: @ 8 MHz (internal oscillator; BOD disabled)

it matches the other board.txt formats but still same error message

Well somehow it worked itself out and now my tiny is fully programmed. :grin: