Pages: [1]   Go Down
Author Topic: Problemas na compliação  (Read 794 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ola,sou novo aqui

estou tendo um problema na compliação, esta dando um erro: tone1 was not declared in this scope e secleciona Tone tone1; é para tocar o tema do mario no alto falante

Code:
Tone tone1;

void setup()
{
  tone1.begin(11);//Playback on Pin 11, change to whatever you may need
}

void loop()
{
tone1.play(660,100);
delay(75);tone1.play(660,100);
delay(150);tone1.play(660,100);
delay(150);tone1.play(510,100);
delay(50);tone1.play(660,100);
delay(150);tone1.play(770,100);
delay(275);tone1.play(380,100);
delay(287);tone1.play(510,100);
delay(225);tone1.play(380,100);
delay(200);tone1.play(320,100);
delay(250);tone1.play(440,100);
delay(150);tone1.play(480,80);
delay(165);tone1.play(450,100);
delay(75);tone1.play(430,100);
delay(150);tone1.play(380,100);
delay(100);tone1.play(660,80);
delay(100);tone1.play(760,50);
delay(75);tone1.play(860,100);
delay(150);tone1.play(700,80);
delay(75);tone1.play(760,50);
delay(175);tone1.play(660,80);
delay(150);tone1.play(520,80);
delay(75);tone1.play(580,80);
delay(75);tone1.play(480,80);
delay(175);tone1.play(510,100);
delay(275);tone1.play(380,100);
delay(200);tone1.play(320,100);
delay(250);tone1.play(440,100);
delay(150);tone1.play(480,80);
delay(165);tone1.play(450,100);
delay(75);tone1.play(430,100);
delay(150);tone1.play(380,100);
delay(100);tone1.play(660,80);
delay(100);tone1.play(760,50);
delay(75);tone1.play(860,100);
delay(150);tone1.play(700,80);
delay(75);tone1.play(760,50);
delay(175);tone1.play(660,80);
delay(150);tone1.play(520,80);
delay(75);tone1.play(580,80);
delay(75);tone1.play(480,80);
delay(250);tone1.play(500,100);
delay(150);tone1.play(760,100);
delay(50);tone1.play(720,100);
delay(75);tone1.play(680,100);
delay(75);tone1.play(620,150);
delay(150);tone1.play(650,150);
delay(150);tone1.play(380,100);
delay(75);tone1.play(430,100);
delay(75);tone1.play(500,100);
delay(150);tone1.play(430,100);
delay(75);tone1.play(500,100);
delay(50);tone1.play(570,100);
delay(110);tone1.play(500,100);
delay(150);tone1.play(760,100);
delay(50);tone1.play(720,100);
delay(75);tone1.play(680,100);
delay(75);tone1.play(620,150);
delay(150);tone1.play(650,200);
delay(150);tone1.play(1020,80);
delay(150);tone1.play(1020,80);
delay(75);tone1.play(1020,80);
delay(150);tone1.play(380,100);
delay(150);tone1.play(500,100);
delay(150);tone1.play(760,100);
delay(50);tone1.play(720,100);
delay(75);tone1.play(680,100);
delay(75);tone1.play(620,150);
delay(150);tone1.play(650,150);
delay(150);tone1.play(380,100);
delay(75);tone1.play(430,100);
delay(75);tone1.play(500,100);
delay(150);tone1.play(430,100);
delay(75);tone1.play(500,100);
delay(50);tone1.play(570,100);
delay(110);tone1.play(500,100);
delay(150);tone1.play(760,100);
delay(50);tone1.play(720,100);
delay(75);tone1.play(680,100);
delay(75);tone1.play(620,150);
delay(150);tone1.play(650,200);
delay(150);tone1.play(1020,80);
delay(150);tone1.play(1020,80);
delay(75);tone1.play(1020,80);
delay(150);tone1.play(380,100);
delay(150);tone1.play(500,100);
delay(150);tone1.play(760,100);
delay(50);tone1.play(720,100);
delay(75);tone1.play(680,100);
delay(75);tone1.play(620,150);
delay(150);tone1.play(650,150);
delay(150);tone1.play(380,100);
delay(75);tone1.play(430,100);
delay(75);tone1.play(500,100);
delay(150);tone1.play(430,100);
delay(75);tone1.play(500,100);
delay(50);tone1.play(570,100);
delay(210);tone1.play(585,100);
delay(275);tone1.play(550,100);
delay(210);tone1.play(500,100);
delay(180);tone1.play(380,100);
delay(150);tone1.play(500,100);
delay(150);tone1.play(500,100);
delay(75);tone1.play(500,100);
delay(150);tone1.play(500,60);
delay(75);tone1.play(500,80);
delay(150);tone1.play(500,60);
delay(175);tone1.play(500,80);
delay(75);tone1.play(580,80);
delay(175);tone1.play(660,80);
delay(75);tone1.play(500,80);
delay(150);tone1.play(430,80);
delay(75);tone1.play(380,80);
delay(300);tone1.play(500,60);
delay(75);tone1.play(500,80);
delay(150);tone1.play(500,60);
delay(175);tone1.play(500,80);
delay(75);tone1.play(580,80);
delay(75);tone1.play(660,80);
delay(225);tone1.play(870,80);
delay(162);tone1.play(760,80);
delay(300);tone1.play(500,60);
delay(75);tone1.play(500,80);
delay(150);tone1.play(500,60);
delay(175);tone1.play(500,80);
delay(75);tone1.play(580,80);
delay(175);tone1.play(660,80);
delay(75);tone1.play(500,80);
delay(150);tone1.play(430,80);
delay(75);tone1.play(380,80);
delay(300);tone1.play(660,100);
delay(75);tone1.play(660,100);
delay(150);tone1.play(660,100);
delay(150);tone1.play(510,100);
delay(50);tone1.play(660,100);
delay(150);tone1.play(770,100);
delay(225);tone1.play(380,100);
//tells the user it is over and delays it a little before going to the top again
delay(1000);
tone1.play(440,200);
delay(200);
delay(200);
tone1.play(440,400);
delay(200);
delay(200);
delay(5000);
}
Logged

'round the world...
Offline Offline
Faraday Member
**
Karma: 42
Posts: 3222
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

fizeste include da libraria onde está definido o tipo Tone?

Logged

Eu não sou o teu criado. Se respondo no fórum é para ajudar todos mediante a minha disponibilidade e disposição. Responder por mensagem pessoal iria contra o propósito do fórum e por isso evito-o.
Se realmente pretendes que eu te ajude por mensagem pessoal, então podemos chegar a um acordo e contrato onde me pagas pela ajuda que eu fornecer e poderás então definir os termos de confidencialidade do meu serviço. De forma contrária toda e qualquer ajuda que eu der tem de ser visível a todos os participantes do fórum (será boa ideia, veres o significado da palavra fórum).
Nota também que eu não me responsabilizo por parvoíces escritas neste espaço pelo que se vais seguir algo dito por mim, entende que o farás por tua conta e risco.

Dito isto, mensagens pessoais só se forem pessoais, ou seja, se já interagimos de alguma forma no passado ou se me pretendes convidar para uma churrascada com cerveja (paga por ti, obviamente).

Sao Paulo - Brazil
Offline Offline
Sr. Member
****
Karma: 0
Posts: 268
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

a novas versões da IDE do Arduino já incluem no core uma implementação da função Tone
veja em
http://arduino.cc/en/Reference/Tone
sendo assim vc não precisa incluir nenhuma lib no entanto vc precisa inicializar corretamente as instâncias do tipo Tone.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, resolvido. foi só incluir o tone.h
Logged

Pages: [1]   Go Up
Jump to: