Skip to content
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

Open
lumarseg opened this issue Aug 11, 2015 · 5 comments
Open

Comments

@lumarseg
Copy link

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

@trackuino
Copy link
Owner

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.

@lumarseg
Copy link
Author

So, if I change the setting timer 2 to timer 3 or 4, I need to modify the PCB Gerber files, right?

@lumarseg
Copy link
Author

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).
This project is for a charitable cause. It will be launch in August 28th, in Campus Party Costa Rica. But unfortunally we have some troubles to test the prototype.
The Arduino Expansion Shield is attache to a Raspberry Pi. The Raspberry Pi will take pictures above the ground.
The Radio Club in Costa Rica is enabling 3 digipeters in the highest mountains of the country. Yesterday we had successful results with one Digipeter and the APRS Server to post data in APRS.FI
Mr. Martin, we appreciate so much any cooperation you can give us in this way.

@trackuino
Copy link
Owner

So, if I change the setting timer 2 to timer 3 or 4, I need to modify the PCB Gerber files, right?

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.

@lumarseg
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants