Notifications
Clear all

Issues Trying to get past IDE compile errors I'm seeing in the Elegoo V4 .ino code

80 Posts
9 Users
8 Likes
11.6 K Views
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7098
 

@jims123 Glad to hear you worked thru the issues. Also real happy that you updated us, it's important for everyone following to learn the solution.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
(@jims123)
Member
Joined: 2 years ago
Posts: 35
Topic starter  

Well I have yet another update for those of you considering this Elegoo Robot V4.0.. and no I did not get it free from Elegoo, nor are they sponsoring this endorsement in any way. 

Since posting my last they sent me a new s/w update to the main program, and it now not only compiles and UPLOADs without errors but it also allows the program and all functions to run under the latest AVR UNO Boards manager Rev 1.8.5 too.

I also got a schematic for the Shield that plugs onto the Elegoo UNO R3 board and a detailed wire table which shows you what Analog or Digital or IC2 pin Number is supporting each of the various functions the robot can do. and..

I believe I mentioned earlier that with a simple speed parameter adjustment it's easy to slow the dang thing down so it's more easily steerable without doing wheelies.  Another thing worth mentioning is there is an open/spare 3 pin header for a PWM servo. This V4 robot doesn't come with it, it only has the one servo to allow Horizontal Sonar scanning with a ultrasonic sensor and the ESP32 CAM mounted on top of it.. But the cool thing is you can Add your own servo to the robot and the App that runs via Wifi on your tablet or Phone can control it too..  if you simply select the "Conquerer" variant robot , it has a PAN and Tilt gimball control and runs the same  UNO and ESP s/w so you can control that second servo +/- 180 degrees with the App too. I plan to put a small laser on it an mount it up front so as you drive up to targets you can zap them with the laser. .. I may need to turn the laser ON and OFF with the IR Remote tho..

Topically Elegoo service "Brad" has been replying with a single day's turn around time. very quick so even tho this code is way to complicated for me to make significant mods to it .. it's been a great experience getting a look at a more complex system of some 19 different Tabs of .cpp and .h libraries and fun to see how they fit together even tho I have no real understanding of the interrupts and serial JSON command passing foing on between the three processors  the UNO, the ESP32 and the Wifi App.. 

I should add the s/w is very well commented in English now too. 

I got a second V4 robot to experiment with and make and tests h/w and s/w mods while the kids can play with the second one, and I thin it will be fun to race them too.. Sadly the price did go up from $63 on Amazon to $69.95 but I still think it's a deal at that price..   I hope our hero Bill does a video on this robot and it's software which is the most challenging part of it some day..       

        

This post was modified 2 years ago 3 times by Jims123

   
Inst-Tech and Lee G reacted
ReplyQuote
Lee G
(@lee-g)
Member
Joined: 3 years ago
Posts: 66
 

@jims123 

Thanks for the update. I’ve been seriously thinking about getting one of these robots to “play” with. Since there are several brands on the market, I have been torn as to which one to get. Your reviews here have helped narrow the choice (now down to this Elegoo one and Sunfounder Picar-x). Thanks again.

Lee


   
Inst-Tech reacted
ReplyQuote
(@jims123)
Member
Joined: 2 years ago
Posts: 35
Topic starter  

Hi Lee, 

I'm very glad to hear it.. 

I also got a Makeblock mBot Mega but it's no where near the fun as this little guy and although the mBot Mega is a lot better made ( out of a sturdy aluminum) and more versatile when moving sideways and in a zig zag.. I found that the code in it was even more complex and daunting if you hope to modify it, since they have one generic code base and depending on #include and conditional linking statements, that one set of code runs on all their different types of robots, so its hard to figure out what's going on, in your particular model.  The comments in it are vague to non-existent too.  But with no camera, grabber arm or laser it's no where near the fun as the Elegoo .. their support was pretty lousy too and they stopped replying to me when they figured out what I was trying to do.. which was simply to understand and then modify their robot's h/w and s/w ..  I hope to get back to it and do so later .. but this Elegoo was great by comparison .. I also looked at ACBR.. anyonecanbuildrobots.com They make a VERY cool set of robots .. if they can ever get the parts.. and the lead guy teaches kids robots by day and does YT Videos on how they work that  are really excellent too..

     


   
Inst-Tech reacted
ReplyQuote
Inst-Tech
(@inst-tech)
Member
Joined: 2 years ago
Posts: 554
 

@jim,  Glad you solved your problem, that's some Pretty cool stuff with your robot..

I'm now in the process of adding more sensors to my Keyestudio Tank robot..it comes with  Bluetooth, IR control, ultrasonic sensor for object avoidance, and photo sensors for light following. Now I'm adding IR avoidance as it has no protection in reverse...lol, and the HC-SR04 just can't "see" everything because of the materials that absorb sound don't reflect it back, so you need a back up so you don't crash into everything...I'm also going to mount a HuskyLens AI camera on it for object recognition..now that's gonna be a challenge!

Indeed, the hard part is figuring out what all the code does so that you can make the modification, but that's the fun part, at least for me!  Hang in there, you'll do fine...Look into the Keyestudio Tank Robot..

regards,

LouisR

Robot Tank

 

LouisR


   
ReplyQuote
(@eliza)
Member
Joined: 2 years ago
Posts: 81
 

@jims123 I have had the problem of having libraries in the libraries directory in my source code tree, and also a libraries directory in the Arduino installation directory tree and then I added a library with a .zip file and the arduino ide created a 3rd libraries directory in a place of its own choosing. Perhaps you have a "surprise" library directory that install with .zip is using, or already used, where the IDE finds the previously installed library that you thought you deleted.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7098
 

@eliza There are supposed to be 3 library sources. There is a hierarchy, IDE then overridden by the library in Arduin15 then overridden by the library in your source directory. It's in the documentation on www.arduino.cc

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
Eliza reacted
ReplyQuote
(@eliza)
Member
Joined: 2 years ago
Posts: 81
 

@zander Thanks for this info. I'll stop worrying about the 3 dirs.

 


   
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@zander

Posted by: @zander

@eliza There are supposed to be 3 library sources. There is a hierarchy, IDE then overridden by the library in Arduin15 then overridden by the library in your source directory. It's in the documentation on www.arduino.cc

As far as I know, there is only one local library location... what are these 3 library sources you speak of?

Cheers


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7098
 

@frogandtoad If by local you mean the location where you install libraries via the Sketch/Include Library/Add .ZIP Library... then yes, just one under your source or sketch library specified in the preferences. Here is an interesting snippet from the arduino documentation. Notice the part it says about deleting and creating fresh the IDE library . I think this is how some people get into trouble with libraries, they manually install instead of using the IDE Menu options (2 different commands for 2 of the different libraries). I include another screen shot of a search in the system library for Ethernet. This shows how complicated these libraries are. There are many implementations with subtle differences of the underlying hardware so the arduino ide keeps it sorted for you.

Screen Shot 2022 03 20 at 06.30.40

The reason why some folks have library trouble is they didn't understand there are ONLY 2 safe ways to manage your libraries.

The first is Tools/Manage Libraries... and will give you a screen as shown. These are the 'official' libraries. Some of these go in the arduino15 dir structure, and some go in your Sketches/libraries dir depending on if they are contributed or from arduino.

Screen Shot 2022 03 20 at 06.55.25

The second way is Sketch/Include Library/Add .ZIP library these are very often located on Github. While in that menu structure note the Manage Libraries entry, this is the 2nd way into the Library Manager. ESPECIALLY note the greyed out headings on the drop down sub-menu. It says 'Arduino Libraries', 'Contributed Libraries', and you may have to scroll down the sub-menu to see 'Recommended Libraries' (Note how that is 3)

Screen Shot 2022 03 20 at 07.00.18

 Finally here is a search of the arduino system libraries for ethernet.h, notice how many copies there are this is because I have ESP8266 and ESP32 as well as UNO, Mega, and Raspberry Pi Pico 2040 installed

Screen Shot 2022 03 20 at 06.42.40
Screen Shot 2022 03 20 at 07.17.46

 I hope that clarifies libraries for you. The ONE thing I want you to take away is to NEVER 'manage' your libraries by using anything other than the Arduino IDE and it's tools under the menus, especially do NOT use your file manager be it Mac Finder, or Windows File Explorer to copy, move, delete files anywhere on your HDD or SSD other than in your user space, ie sketchbook folder!!!!!

 

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
YurkshireLad reacted
ReplyQuote
(@eliza)
Member
Joined: 2 years ago
Posts: 81
 

Thanks. This is helpful and well appreciated. I have a lot of experience programing c  unix so I'm just the kind of guy to go in and mess with things manually. Indeed I'm planning to teach an "advanced" arduino class in our makerspace this month yet I can see now how uninformed I am about the library file structure. I'll be studying your post thoroughly.

Steve A.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7098
 

@eliza I probably don't need to tell you this, but the arduino.cc web site is a wealth of information on libraries and much more. I used to work at IBM Canada and did some teaching while there. If your students are truly advanced that to me means they know what every selection on the IDE menu system does for a start. It also means they know all the preference fields and have them set optimally.

It also means they know how to get to the language reference HERE and at least are familiar with the sections on functions, variables, and structure. Eventually they should have all that memorized.

Now comes the hard part, figuring out which libraries are useful for a given program (sketch). If I am starting a serious project, I will spend a few hours poring over what libraries are available that are applicable to my project. This is an area that Arduino needs to improve on, it does not produce very useful results just searching it.

Keep in mind the actual file structure for the libraries is different for the 3 platforms (Win, Mac, *nix). Nobody NEEDS to know the path of the IDE library or the CORE library. We had at least 3 incidents including the OP of this thread who 'messed' with those and came here asking for help. Had they did some studying of how to use the product (Arduino IDE) they would have known to ONLY install via the IDE.

I would NOT tell them where they are. When they have enough experience then knowing the guts may move them from experienced to wizard.

There are very rare cases where a library can only be installed manually, but that is always done in the (SketchBook)/libraries folder. I have never had to do it yet, but if/when I create my own library that is what I will do until and unless I put the code up on github.

I just had a thought, if I was in your shoes, I would include looking at the Libraries page and then clicking each link of the groups. In each of those you will see Official Libraries and Contributed by the Community. The later is often/always a lot longer list. However what level of competency and support do you get from each group?

Sorry to go on so long, but feel free to ask me anything you want, maybe in a private message?

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
(@eliza)
Member
Joined: 2 years ago
Posts: 81
 

how where do you do a private message?


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7098
 

@eliza At the top, click on Members. In the search box enter ron or zander even better. There is a few icons there beside my name, the last one is an envelope.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
(@eliza)
Member
Joined: 2 years ago
Posts: 81
 

@zander Found the member finder but I get "you are not yet permitted to send a message." Guess I have to pay my dues.


   
ReplyQuote
Page 3 / 6