Hi, i am new to arduino and mlr, and i am trying to run "the Second MRL tutorial - tracking service with wiring diagram", but when i try to upload the code generated by mrlcomm in tracker.arduino to my Leonardo i get this compile error:

Arduino: 1.6.6 (Windows 7), Board: "Arduino Leonardo"
 
C:\Users\Cunha\AppData\Local\Temp\arduino_f845b0736e4899d0ca24a4357e6bffaf\sketch_nov29d.ino:205:0: warning: "SOFT_RESET" redefined [enabled by default]
 
 #define SOFT_RESET         253
 
 ^
 
C:\Users\Cunha\AppData\Local\Temp\arduino_f845b0736e4899d0ca24a4357e6bffaf\sketch_nov29d.ino:153:0: note: this is the location of the previous definition
 
 #define SOFT_RESET    43
 
 ^
 
C:\Users\Cunha\AppData\Local\Temp\arduino_f845b0736e4899d0ca24a4357e6bffaf\sketch_nov29d.ino: In function 'void setPWMFrequency(int, int)':
 
sketch_nov29d:482: error: 'TCCR2B' was not declared in this scope
 
     TCCR2B &= ~clearBits;
 
     ^
 
C:\Users\Cunha\AppData\Local\Temp\arduino_f845b0736e4899d0ca24a4357e6bffaf\sketch_nov29d.ino: In function 'void loop()':
 
sketch_nov29d:990: error: call of overloaded 'write(int)' is ambiguous
 
         Serial.write(0);  // MSB
 
                       ^
 
C:\Users\Cunha\AppData\Local\Temp\arduino_f845b0736e4899d0ca24a4357e6bffaf\sketch_nov29d.ino:990:23: note: candidates are:
 
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:225:0,
 
                 from sketch\sketch_nov29d.ino.cpp:1:
 
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/USBAPI.h:103:17: note: virtual size_t Serial_::write(uint8_t)
 
  virtual size_t write(uint8_t);
 
                 ^
 
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26:0,
 
                 from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,
 
                 from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:224,
 
                 from sketch\sketch_nov29d.ino.cpp:1:
 
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:49:12: note: size_t Print::write(const char*)
 
     size_t write(const char *str) {
 
            ^
 
exit status 1
'TCCR2B' was not declared in this scope
 
  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.

 

Any help would be great. Thanks in advance.

GroG

8 years 11 months ago

Hello and Welcome Proteusy !

Ya you probably can remove the whole setFrequency method and the timer defines,  they were originally used for setting less audible PWM for motor controls.

Regards,

GroG