si.
ecco il codice completo:
// LIBRERIE
#include <Servo.h>
#include <IRremote.h>
#include <IRremoteInt.h>
// DICHIARAZIONI
int freq = 1047;
int pinbuzz = 8;
int RECV_PIN = 11; // ricevitore IR
IRrecv irrecv(RECV_PIN);
decode_results results;
Servo ServoMc;
int zero = 60; //posizione 1°
int media = 90; //posizione 2° finale
int pause=200;
int scatto=737;
void setup()
{
ServoMc.attach(9);
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}
void loop()
{
if (irrecv.decode(&results)) {
Serial.println(results.value,DEC);
irrecv.resume(); // Ricevi prossimo valore
if (results.value == 52122){
ServoMc.write(zero);
delay(scatto);
ServoMc.write(media);
delay(scatto);
tone(pinbuzz, freq);
irrecv.resume(); // Receive the next value
Vedo ora che anche se cancello tone() il codice da errore lo stesso
precisamente cosi':
IRremote\IRremote.cpp.o: In function `MATCH(int, int)':
/IRremoteInt.h:179: multiple definition of `MATCH(int, int)'
ScattoIRSound.cpp.o:C:\Program Files (x86)\Arduino\libraries\IRremote/IRremoteInt.h:179: first defined here
IRremote\IRremote.cpp.o: In function `MATCH_MARK(int, int)':
/IRremoteInt.h:180: multiple definition of `MATCH_MARK(int, int)'
ScattoIRSound.cpp.o:C:\Program Files (x86)\Arduino\libraries\IRremote/IRremoteInt.h:180: first defined here
IRremote\IRremote.cpp.o: In function `MATCH_SPACE(int, int)':
/IRremoteInt.h:181: multiple definition of `MATCH_SPACE(int, int)'
ScattoIRSound.cpp.o:C:\Program Files (x86)\Arduino\libraries\IRremote/IRremoteInt.h:181: first defined here