Why is my code saying "Error Compiling for Arduino Nano"

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
animefruit
 
Posts: 332
Joined: Tue Feb 25, 2020 1:04 pm

Re: Why is my code saying "Error Compiling for Arduino Nano"

Post by animefruit »

In the above post I show you how I installed them.

Some Radio files are under libraries and some are within libraries as the pictures show.

How did I install them wrong?

How can I install them better?

User avatar
dastels
 
Posts: 15662
Joined: Tue Oct 20, 2015 3:22 pm

Re: Why is my code saying "Error Compiling for Arduino Nano"

Post by dastels »

You want the library folders in libraries, not libraries/New Folder.
Did you fix that?

Dave

User avatar
animefruit
 
Posts: 332
Joined: Tue Feb 25, 2020 1:04 pm

Re: Why is my code saying "Error Compiling for Arduino Nano"

Post by animefruit »

I re-downloaded the RFM69 Library Zip from the green button on this website a couple of times and my other computer finally works!

https://learn.adafruit.com/adafruit- ... fm69-radio

I also found out that there was a USB issue, so I just used another USB.

Although the other computer I was using can still not detect the Port, even with the New USB.

But that is ok because I got the other computer to work so I have 2 computers for my 2 RFM69 Radios.

So that is great!

Maybe we will pick up with that other error “Can’t Compile to Arduino Nano”for that code later, like tomorrow or the next day.

But I am glad I fixed it to where two computers can now use the basic Radio Head code!

User avatar
animefruit
 
Posts: 332
Joined: Tue Feb 25, 2020 1:04 pm

Re: Why is my code saying "Error Compiling for Arduino Nano"

Post by animefruit »

Hey Dave.

I was going to have a technology guy like you help me with my project in person.

I was going to get with him next weekend or so.

But I was wondering if you could still help me work on it from what he told me about my project before then.

Here is what he said about my project:
Hi Neal,
 
You will want to start taking some of your code and putting it into their own functions. This will allow you to call that function from wherever you need. For example, your setup function can have only the portions needed for setting up the radio put into a function called radioSetup() and called from within the setup function itself. The same can be done for the loop function.

We can also discuss putting your code into separate files as it is starting to get to a point where it needs to be managed more in line with object-oriented programming practices. Either way, from looking over the code, we can simplify this by doing a couple of things with just the radio file below:
 
Simplify:
Remove the unnecessary “#if define” statements as some are needed for microcontrollers you are not using.
Containerize:
                Break the setup and loop functions into smaller functions. Here is an example:
 
 
Original:
 
void setup()
{
                General Setup Statement #1
General Setup Statement #2
General Setup Statement #3
General Setup Statement #4
 
OLED Setup Statement #1
OLED Setup Statement #2
 
Radio Setup Statement #1
Radio Setup Statement #2
}
 
Containerized:
 
void oledSetup()
{
OLED Setup Statement #1
OLED Setup Statement #2
}
 
void radioSetup()
{
Radio Setup Statement #1
Radio Setup Statement #2
}
 
void setup()
{
                General Setup Statement #1
General Setup Statement #2
General Setup Statement #3
General Setup Statement #4
}
 
Eventually, you will need to familiarize yourself with object-oriented programming practices and adding addition header and cpp files linked together within the same project.
Do you know what code I could use according to what he said?

Do you know how to do “object oriented programming practices” that calls a function from wherever I need?

If so, can you tell me how to do that in my code?

If you could do so that would be great!

User avatar
dastels
 
Posts: 15662
Joined: Tue Oct 20, 2015 3:22 pm

Re: Why is my code saying "Error Compiling for Arduino Nano"

Post by dastels »

It really sounds like you need some basic programming knowledge. There are plenty of C++ and arduino tutorials online and in print. Simon Monks Arduino books: https://www.amazon.com/Programming-Ardu ... 264676980/ and https://www.amazon.com/Programming-Ardu ... 260143244/. This looks like a good (and free) course: https://www.learncpp.com/.

Dave

User avatar
animefruit
 
Posts: 332
Joined: Tue Feb 25, 2020 1:04 pm

Re: Why is my code saying "Error Compiling for Arduino Nano"

Post by animefruit »

Ok.

Thanks for the tutorials.

Those may be helpful.

I might just wait until I see that other tech person in person for him to help me with it though.

If I have any other questions while working on my project I will ask you though.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”