'REG_PMC_PCER1' was not declared in this scope -OV7670 camera code error

Hi there, im trying to conenct the OV7670 camera with the Arduino UNO. I'm following this tutorial and i'm having a problem with the code. When i try to upload it i get an error that says: 'REG_PMC_PCER1' was not declared in this scope. I have no idea what to do and i couldn't find anything online.

This is the code (i have marked the point of the issue with *******************************):
(sorry it's in pastebin, it has too many characters)

And here is the error code:
(also in pastebin)

Thanks in advance,
Ali

If the sketch is longer than the forum will allow then it's OK to add it as an attachment. If you're making a reply, you will see the "Attachments and other options" link after you click "Reply" (it's not shown in "quick reply" mode). Don't put your code in some external file service like pastebin because some people won't bother to visit an external site, and thus you'll be less likely to get help.

The code you're trying to compile has architecture-specific code that will only work on the Arduino Due. It's not compatible with the Uno you're trying to compile for, thus the error.

You have a few options to deal with this:

  • Use a Due instead of the Uno.
  • Find or write some code that's compatible with the Uno.
  • Modify the code you're currently using to work with the Uno.

pert:
If the sketch is longer than the forum will allow then it's OK to add it as an attachment. If you're making a reply, you will see the "Attachments and other options" link after you click "Reply" (it's not shown in "quick reply" mode). Don't put your code in some external file service like pastebin because some people won't bother to visit an external site, and thus you'll be less likely to get help.

The code you're trying to compile has architecture-specific code that will only work on the Arduino Due. It's not compatible with the Uno you're trying to compile for, thus the error.

You have a few options to deal with this:

  • Use a Due instead of the Uno.
  • Find or write some code that's compatible with the Uno.
  • Modify the code you're currently using to work with the Uno.

Would you be able to help me with that or know if anyone can? I'm a beginner when it comes to coding...

Thanks

The people on this forum are willing to help out, but you need to take the initiative. Spend some quality time working away at the problem and then come back here when you have specific questions that you can't find an answer to.

The first thing you need to know is that YouTube video is complete garbage. Since they claim the code will run on the Uno, the person who made the video clearly doesn't have even the slightest clue what they're talking about. The idiot didn't even bother to do the most minimal testing of the code. From the comments on the video, you can see they've caused a lot of confusion and frustration for many people. Even compiling for the Due, the code linked from that video won't work since it's two separate sketches smashed together. That problem can be easily fixed but at this point I suspect there are other problems with the code. You're better off to spend some time looking around for something of higher quality to start with.

This is actually a very good lesson for you as a beginner. There is a lot of really great information on the Internet, but there is also a lot of really terrible information. You need to always use critical thinking to evaluate the quality of the information.

pert:
The people on this forum are willing to help out, but you need to take the initiative. Spend some quality time working away at the problem and then come back here when you have specific questions that you can't find an answer to.

The first thing you need to know is that YouTube video is complete garbage. Since they claim the code will run on the Uno, the person who made the video clearly doesn't have even the slightest clue what they're talking about. The idiot didn't even bother to do the most minimal testing of the code. From the comments on the video, you can see they've caused a lot of confusion and frustration for many people. Even compiling for the Due, the code linked from that video won't work since it's two separate sketches smashed together. That problem can be easily fixed but at this point I suspect there are other problems with the code. You're better off to spend some time looking around for something of higher quality to start with.

This is actually a very good lesson for you as a beginner. There is a lot of really great information on the Internet, but there is also a lot of really terrible information. You need to always use critical thinking to evaluate the quality of the information.

Thank you so much! Where would you suggest I start? I really do thank you for your help. I will try and learn the basics of coding but i need a starting point to make sure im not jumping ahead and doing things that are way out of my league (to be honest such as this project).

Start on Google searching for an Uno-compatible library for OV7670. I think a library will be best, since that will tend to make it easier for you to write simple sketches that do what you want, with the complex code hidden away in the library where it won't confuse you (though you can always open up the library source files in a text editor if you want to look at the code). The libraries will usually come with some example sketches that demonstrate how to use them.

If you find multiple libraries, you will want to evaluate them to see if you can determine which is best.

I tend to prefer software that's hosted on GitHub. GitHub makes collaboration very easy, which tends to result in higher quality work. It's quite likely that anyone using GitHub is also doing version control, which is essential in creating quality software.

GitHub also gives you some indicators of the quality of the software. On the home page of the repository, you can see how many "stars", "forks", and "watchers" it has.

You can also take a look at the "Issues" (which may include feature requests in addition to bug reports). Although you might think lots of bug reports is a bad thing, it also indicates a strong community of active users. More important is to see how the repository maintainers are dealing with the issues. If there are obvious, serious issues with a simple fix that have not been resolved after many months, that's a bad sign.

Similar is the "Pull Requests". These are bug fixes or enhancements submitted by the community. Lots of pull requests indicates a large, strong community, but lots of obviously valid pull requests which are completely ignored by the maintainers is a bad sign.

You can also look at the "Commits" tab, which shows the development history of the project. This will show you how active the development of the project is.

Another good thing to check on is how much documentation is provided, and the quality of that documentation. Unfortunately, a lot of very skilled programmers don't like writing documentation. If the code is excellent but we can't figure out how to use it, it doesn't do us much good.

You do need to be a bit careful about how you interpret these indications. An incredible project that has recently been published will not have had time to accumulate lots of stars, etc. A project that has not been updated in years might have been perfected and not need any additional work.