'playtone not declared in this scope'

Could someone please help with the issue I’m having… I need to add sound to my robot but for some reason the color wipe and the playtone part gives me this error message and i don’t know why. Any help would be greatly appreciated!

Arduino: 1.6.12 (Windows 10), Board: “Arduino/Genuino Uno”

C:\Users\sambo\Desktop\ROBOTWARSV2\ROBOTWARSV2.ino: In function ‘void setup()’:

ROBOTWARSV2:29: error: ‘playTone’ was not declared in this scope

playTone((3000-9*i), 2);}

^

exit status 1
‘playTone’ was not declared in this scope

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

ROBOTWARSV2.ino (4.72 KB)

Looks like you're missing a library that contains the function playTone(), are you sure you have included all required libraries?

i thought playtone doesnt need a library

i have a library void for playtone at the bottom of the program

SAMHAWK: i have a library void for playtone at the bottom of the program

Where exactly is the function ?

Are you talking about Arduino’s builtin Tone library?
https://www.arduino.cc/en/Reference/Tone
Try the correct syntax.

for (int i = 1;i < 254;i++) // Loop plays start up noise
   tone(speakerPin,3000-9*i, 2);

Your setup() is missing one }.

Tools > Auto Format will help you spot this kind of errors.