My code won't upload to my nodemcu 32s (esp32)

How do i fix this error : [[C:\Users\byron\Documents\Arduino\nodemcu_car_wifi\nodemcu_car_wifi.ino: In function ‘void moveControl(int, int)’:

nodemcu_car_wifi:76:29: error: ‘analogWrite’ was not declared in this scope

analogWrite(leftMotorENB,z);

^

nodemcu_car_wifi:97:31: error: ‘analogWrite’ was not declared in this scope

{ analogWrite(leftMotorENB,z);

^

nodemcu_car_wifi:119:30: error: ‘analogWrite’ was not declared in this scope

analogWrite(leftMotorENB,z);

^

nodemcu_car_wifi:139:31: error: ‘analogWrite’ was not declared in this scope

analogWrite(leftMotorENB,z);

^

Multiple libraries were found for “WiFi.h”
Used: C:\Users\byron\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\WiFi
Not used: C:\Users\byron\Documents\Arduino\libraries\WiFiNINA
Not used: C:\Program Files (x86)\Arduino\libraries\WiFi
exit status 1
‘analogWrite’ was not declared in this scope]

Heres my code, its suppose to make a wifi blynk controlled car using a nodemcu 32s [//*************************************************************
Download latest Blynk library here:

Blynk is a platform with iOS and Android apps to control
Arduino, Raspberry Pi and the likes over the Internet.
You can easily build graphic interfaces for all your
projects by simply dragging and dropping widgets.

Downloads, docs, tutorials: http://www.blynk.cc
Sketch generator: http://examples.blynk.cc
Blynk community: http://community.blynk.cc
Follow us: http://www.fb.com/blynkapp
http://twitter.com/blynk_app

Blynk library is licensed under MIT license
This example code is in public domain.


This example runs directly on ESP32 chip.

Note: This requires ESP32 support package:

Please be sure to select the right ESP32 module
in the Tools → Board menu!

Change WiFi ssid, pass, and Blynk auth token to run :slight_smile:
Feel free to apply it to any other example. It’s simple!
*************************************************************/

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial

#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include <Arduino.h>
/* define L298N or L293D motor control pins /
int leftMotorForward = 2; /
GPIO2(D4) → IN3 /
int rightMotorForward = 15; /
GPIO15(D8) → IN1 /
int leftMotorBackward = 0; /
GPIO0(D3) → IN4 /
int rightMotorBackward = 13; /
GPIO13(D7) → IN2 */
int z;

/* define L298N or L293D enable pins /
int rightMotorENB = 14; /
GPIO14(D5) → Motor-A Enable /
int leftMotorENB = 12; /
GPIO12(D6) → Motor-B Enable */

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
// Use your own WiFi settings
char auth = “9urFd8PKOP6UKZElxRd2MhAcD3JG_py8”;
char ssid = “VM-guest3657864”;
char pass = “GuestH0use”;
// neutral zone settings for x and y
// joystick must move outside these boundary numbers to activate the motors
// makes it a little easier to control the wifi car
int minRange = 312;
int maxRange = 712;
// analog speeds from 0 (lowest) - 1023 (highest)
// 3 speeds used – 0 (noSpeed), 350 (minSpeed), 850 (maxSpeed).
// use whatever speeds you want…too fast made it a pain in the ass to control
int minSpeed = 450;
int maxSpeed = 1023;
int noSpeed = 0;
void moveControl(int x, int y)
{
// movement logic
// move forward

// y je vetsi jak maxrange a současně x je vetsi jak minRange a současne mensi jak max range
if(y >= maxRange && x >= minRange && x <= maxRange) //zataci R
{
analogWrite(leftMotorENB,z);
analogWrite(rightMotorENB,z);

digitalWrite(leftMotorForward,HIGH);
digitalWrite(rightMotorForward,HIGH);
digitalWrite(leftMotorBackward,LOW);
digitalWrite(rightMotorBackward,LOW);
}
//MOVE FORWARD RIGHT
else if(x <= minRange && y >= maxRange )
{
digitalWrite(leftMotorENB,maxSpeed);
digitalWrite(rightMotorENB,minSpeed);
digitalWrite(leftMotorForward,HIGH);
digitalWrite(rightMotorForward,HIGH);
digitalWrite(rightMotorBackward,LOW);
digitalWrite(leftMotorBackward,LOW);
}

// move right
else if(x >= maxRange && y >= minRange && y<=maxRange) //zataci R
{ analogWrite(leftMotorENB,z);
analogWrite(rightMotorENB,z);
digitalWrite(leftMotorForward,HIGH);
digitalWrite(rightMotorForward,LOW);
digitalWrite(rightMotorBackward,HIGH);
digitalWrite(leftMotorBackward,LOW);
}

// move forward LEFT

else if(x <= minRange && y >= maxRange )
{
digitalWrite(leftMotorENB,minSpeed);
digitalWrite(rightMotorENB,maxSpeed);
digitalWrite(leftMotorForward,HIGH);
digitalWrite(rightMotorForward,HIGH);
digitalWrite(rightMotorBackward,LOW);
digitalWrite(leftMotorBackward,LOW);
}
// moveleft
else if(x <= minRange && y >= minRange && y <= maxRange)
{
analogWrite(leftMotorENB,z);
analogWrite(rightMotorENB,z);
digitalWrite(leftMotorForward,LOW);
digitalWrite(rightMotorForward,HIGH);
digitalWrite(rightMotorBackward,LOW);
digitalWrite(leftMotorBackward,HIGH);
}
]

nodemcu_car_wifi.ino (6.13 KB)