New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build on Arduino Leonardo: 'OCR2B' was not declared in this scope #1
Comments
As expected, since the atmega32u4 doesn't have a timer 2. That particular code should be ported to use either timer 3 or timer 4. |
So, if I change the setting timer 2 to timer 3 or 4, I need to modify the PCB Gerber files, right? |
We're building a Trackuino over a Arduino Expansion Shield for Raspberry Pi B+ (http://www.dfrobot.com/index.php?route=product/product&product_id=1211&search=Arduino+Expansion+Shield+for+Raspberry+Pi+B%2B&description=true#.VctUNq12Hw0). |
Right, you would have to change the schematic and use some other pin for audio. Pin 3 in the leonardo can do PWM, but it's mapped to Timer 0, which is used by the arduino libraries to keep track of time (delay, millis) so you can't reprogram Ttimer 0 without breaking those. Also timer2 in the 328p is 8-bit, and timer3/4 in the leonardo are 16/10-bit IIRC. They should be easy to configure to run in 8-bit mode, though. But, given your timeline, I would suggest you use a Uno and keep the tracker/Pi separate, that way you can use the shield + code unmodified. |
We'll use then an Arduino Uno. In two weeks we'll launch the Balloon. Yestarday our Trackuino Shield didn't work. So in this moment we are in trouble. Our time is -6:00 GMT. |
There is a compilation error when the Arduino Leonardo is selected as Board Source:
In file included from afsk.cpp:32:0:
afsk_avr.h: In function 'void afsk_output_sample(uint8_t)':
afsk_avr.h:40: error: 'OCR2B' was not declared in this scope
define OCR2 OCR2B
afsk_avr.h:53:3: note: in expansion of macro 'OCR2'
OCR2 = s;
^
'OCR2B' was not declared in this scope
The text was updated successfully, but these errors were encountered: