Notifications
Clear all

[Closed] Hi, My name is Jim, I'm from Edinburgh and new to forum.

22 Posts
4 Users
2 Likes
1,544 Views
(@jrrobb)
Member
Joined: 12 months ago
Posts: 10
Topic starter  

This is my first post. This is also my first attempt with ESP32 and I have come up against a problem. I have become intrigued with mecanum wheels and built the Mecanum Wheel Robot Car only to hit a problem at the attempt to run the 4wd test .  I get a compilation error as follows.

"exit status"

"Compilation error; 'analogWrite' was not declared in this scope"

"analogWrite(MF_PWMA, speed_slow);" highlighted in the sketch. 

I have tried all the Google help pages without success. I have the up-to-date  version of windows 11 on my computer and have unblocked Arduino in the security system. Can anyone suggest a solution>


   
rommudoh reacted
(@davee)
Member
Joined: 3 years ago
Posts: 1607
 

Hi @jrrobb,

  Welcome to the forum!!

 Sorry, I do not have an immediate solution, but perhaps I could suggest a way that might eventually lead to the desired outcome.

This particular topic area is meant for new members to say 'Hi', and maybe say a little about themselves .. which, you have done... so that is a good start!

Could, I suggest you now start a new thread in the topic area you think best fits your question, and provide more details. Ideally, imagine someone else is trying to reproduce your problem on their computer, but does not have your particular robot car, etc., so describe which IDE, and software you are using. In terms of software program, either include a listing of the code, or a reference to where it can be found if you downloaded it from a source on the web.

Best wishes and good luck, Dave


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

@jrrobb You can't google that. It's the equivalent of 'goodbye'. What it means is you have an error in your environment. I see this all the time, and it is always a struggle to help. Follow the instructions from ARDUINO, not from some social media or anyone else.

@davee If he can't resolve analogWrite, he has a fairly major problem.

@jrrobb Take a screenshot of your display showing what board and port is selected. Now start at the blink sketch and see what happens. Here is what you should see after you start the IDE and select the UNO board. Now select the blink sample and the port (NOTE I changed to the NANO board). Now I select the Sample Basics/Blink. Now I add an analogWrite statement, and by following the popup, help fill in the statement. NOTE I have NOT added any libraries so analogWSrite ZMUST BE builtin into the BOARD library. as can be seen by the successful compile in the last picture. Start at the beginning of the ARDUINO.cc website and spend a few weeks getting familiar with the correct procedure. If you can't replicate what I did then you are doing something wrong.

Screenshot 2023 04 23 at 07.07.53
Screenshot 2023 04 23 at 07.14.44
Screenshot 2023 04 23 at 07.15.58
Screenshot 2023 04 23 at 07.10.26
Screenshot 2023 04 23 at 07.11.08

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.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2504
 

@jrrobb

Check your sketch for mismatched brackets. Probably "{}" but maybe "()".

Anything seems possible when you don't know what you're talking about.


   
(@jrrobb)
Member
Joined: 12 months ago
Posts: 10
Topic starter  

Hi Will,

Thanks for replying to my post. I have checked the code and all is good. Here is a copy of the sketch showing the error.

Screenshot 2023 04 25 100359

 Jim


   
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2504
 

@jrrobb 

It was a long shot, unbalanced brackets can convince the compiler that the code has already ended, so it doesn't think that some commands are still defined.

Check out Ron's post. The most likely cause is incorrect board selection or using an outdated board definition.

Good luck.

Anything seems possible when you don't know what you're talking about.


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

@jrrobb Very weird as analogWrite is built in to the board definition AFAIK, try changing the board to a generic ESP32. If you look at my previous reply you can see that I did the same as you and it worked other than I used a better-known ESP32.

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.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


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

@jrrobb Quick tip, close the left window by clicking the Library icon to free up some space. Now just type anywhere in the sketch exactly analog then tell me better still take a screen shot, the IDE should be giving you a list of all it's known 'things' that start with analog. See my pic

Screenshot 2023 04 26 at 08.34.23

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.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


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

@jrrobb Try this sketch, it compiles just fine;

```cpp

void setup() {

}

void loop() {
  uint8_t pin = 2;
  int value = LOW;

  analogWrite(pin, value);
}

```

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.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


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

@jrrobb Jim, I just noticed you are using a cloud drive. I am not sure that works, and certainly is not good practice. Delete the Arduino directory but first copy any files you created if any somewhere safe and re-install the IDE onto your hard drive or SSD as the case may be.

I can also see an unusual depth to your source folders (see pic) that is not needed. Not a biggie, but having a DBWS folder under the Arduino folder makes sense, then under DBWS any of Bill's projects makes sense. Us programmers like to be well organized so I am just passing along my take on it.

After you delete and re-install be sure to let us know if all is now well.

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.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2504
 

@jrrobb 

Are you starting from Bill's version of the Macanum wheel car ? That is ...

Anything seems possible when you don't know what you're talking about.


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

@jrrobb Jim, It's really, really, really hard to help someone when they don't answer the questions we ask. Your issue can only happen if the installation didn't work correctly. I would NOT install the IDE to Onedrive, but I think the IDE install doesn't require a location in any case. HOWEVER, where you locate the Arduino folder is under your control, and it might be better to keep it local. I think with OneDrive you can later add the Arduino folder to be backed up in Windows, I don't see it in MacOS, though, I just did it a different way and now have 3 copies as a result. Here is a screenshot of how I have my Sketchbook location set up. You can do anything you want. My point is just to start it on your HDD, not in the cloud.

Screenshot 2023 04 28 at 10.28.10

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.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
Inst-Tech reacted
(@jrrobb)
Member
Joined: 12 months ago
Posts: 10
Topic starter  

@zander Hi Ron, Sorry for the delay. I have reinstalled the IDE and here is a copy of a screenshot taken with the additional code you suggested.

Screenshot 2023 05 01 162615

 

  

  

 


   
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2504
 

@jrrobb 

@codecage has suggested that you move this discussion to a more appropriate forum and has created a convenient entry for you. Since he's an administrator, I'd strongly suggest that you move your future replies to that thread 🙂

BTW I've replied to this post in the other thread, see

https://forum.dronebotworkshop.com/postid/39791/

Anything seems possible when you don't know what you're talking about.


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

@jrrobb Looks like there is a HUGE language barrier here and a lack of troubleshooting skills.

When troubleshooting, there are two common first steps: the divide and conquer approach and the second is to try a simple well-known piece of code and see what happens, often the infamous blink or 'hello world' sketches.

I was doing the latter, and the sketch I gave you was standalone, not to be added to your sketch. If it works for me but not you, where do you think the problem is?

I already answered that question with some things to try but maybe I assumed to much in the way of experience.

Try the following sketch with the UNO board selected and if it fails to compile, copy and paste the ENTIRE output screen so I can try to pinpoint your issue.

```cpp
void setup(){
}

void loop() {
  uint8_t pin = 2;
  int value = LOW;

  analogWrite(pin, value);
}

```

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.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
Page 1 / 2