Go Down

Topic: Arduino Create - UnoWiFi2 - error 'OCR1A' was not declared in scope (Read 45 times) previous topic - next topic

bloorr

I am porting some code on Arduino Create from a Mega 2560 to an Uno WiFi Rev 2.

Create recognizes the Uno WiFi is connected.

Create correctly compiles simple LCD display code and the code downloads and runs properly in the WiFi.

But when I attempt to compile the code I am porting from the Mega 2560 I get:

error 'TCNT1' was not declared in scope...
error 'OCR1A' was not declared in scope...
error 'OCR1B' was not declared in scope...
error 'TIMSK1' was not declared in scope...

basically, all the control registers for Timer 1.

The Amtel documentation uses the same register names for the 328 and 2560, and I've seen them used in other Uno examples, so I don't think I have the wrong names.

I suspect a missing header file, but I've tried adding #include <Arduino.h> to no avail.  I tried #include  <iom328p.h> but it could not find the file.

When using Create with the Mega 2560, this was all automatic, so I'm not sure what I'm not doing.

Thanks, Bloor

DrDiettrich


westfw

Unowifi2 has a new processor chip, and the peripherals are NOT the same as previous avrs.
Anything that directly accesses peripheral registers will need re-written.

Go Up