Problem with Arduino Esplora pins

Hi everyone. I just bought an Arduino Esplora and I wanted to know about its pins. i've found this guide http://www.robot-italy.net/downloads/pighixxx/esplora.pdf on the internet, and I need 4 pins like the ones on the Arduino Uno board (on the arduino UNO they are 13). Which are they??
Thank you!

If you're not going to attach the display, I believe you can use any of the I/O pins broken out on the female header on the right side. Their Arduino pin numbers are noted in the purple boxes in your diagram. If you are using the display, then it appears all those pins are used. You can use the SPI pins for multiple SPI devices in addition to the display as long as they each have a separate CS pin. The SPI pins are also broken out on the male 2x3 ICSP header. Arduino pins 3 and 11 are also available via the TinkerKit connectors on the top left edge.

Sorry, what do you mean with "purple"? There aren't any purple boxes in my diagram...which one do you mean? Thank you

Sorry, I didn't want to download that random file so I was looking at the pighixxx Esplora diagram on their official website:
http://www.pighixxx.net/portfolio-items/esplora/

From the "pighixxx" in the URL you posted, I assumed that was the same one you are looking at.

It doesn't work.... Maybe I've done something wrong on the breadboard..?

I mean, number 14 and 15 work but 16 doesn't... I'm trying to sending to it (it's an output) a value between 0 and 255 to make a engine/motor (idk which is correct in English) run with different speeds.
This is the breadboard, I leave here the file of what I'm developing.

#include <Esplora.h>


const int controlPin1 = 14;
const int controlPin2 = 15;
const int enablePin = 16;
//const int directionSwitchPin = 4;
//const int onOffSwitchStateSwitchPin = 5;
//const int potPin = A0;
int potVal = Esplora.readSlider();

int onOffSwitchState = Esplora.readButton(SWITCH_1);
int previousOnOffSwitchState = 0;
int directionSwitchState = Esplora.readButton(SWITCH_2);
int previousDirectionSwitchState = 0;
int motorEnabled = 1;
int motorDirection = 1;
int motorSpeed = 0;


void setup() {
  Serial.begin(9600);
  pinMode(controlPin1, OUTPUT);
  pinMode(controlPin2, OUTPUT);
  pinMode(enablePin, OUTPUT);

  digitalWrite(enablePin, LOW);
}

void loop() {
  
  onOffSwitchState = Esplora.readButton(SWITCH_1);
  delay(1);
  directionSwitchState = Esplora.readButton(SWITCH_2);
  motorSpeed = potVal/4;

  if(onOffSwitchState != previousOnOffSwitchState){
    if(onOffSwitchState == 0) {
      motorEnabled = !motorEnabled;
    }
  }

  if(directionSwitchState != previousDirectionSwitchState){
    if(directionSwitchState == 0){
     motorDirection = !motorDirection;
     
    }
  }

  if(motorDirection == 1){
    digitalWrite(controlPin1, HIGH);
    digitalWrite(controlPin2, LOW);
  } else {
    digitalWrite(controlPin1, LOW);
    digitalWrite(controlPin2, HIGH);
  }
  Serial.println(motorEnabled);
  if(motorEnabled == 1){
  analogWrite(enablePin, motorSpeed);
  } else {
    analogWrite(enablePin, 0);
  }
 previousDirectionSwitchState = directionSwitchState;
 previousOnOffSwitchState = onOffSwitchState;
}

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

Only pins 3, 5, 6, 9, 10, 11, and 13 can be used with analogWrite() on the Esplora. You'd need to use one of the pins on the TinkerKit connectors for that. It is possible to do software PWM to emulate analogWrite() on any pin (though it's inferior to analogWrite(). Here is a pretty good library for that:

nicolopadovandev:
engine/motor (idk which is correct in English)

Motor is most correct.

There are no 3, 5, 6, 9, 10, 11, 13 pins on the Arduino Esplora on the diagram that you sent
This is the image of my breadboard:

IMG_8890.jpg

Pins 3 and 11 are on the orange connectors on the left side of the top edge of the board.

nicolopadovandev's picture:
c98675ca849577ed5ba33ed5d3421874059a75f8.jpg

Thank you, they are the only one? I need 3 pins, and sorry if i’m carrying on this conversation, i just want to be clear

It looks like there are only two free PWM pins on the Esplora. You can use the software PWM library to get 3. It might be more convenient anyway not needing to use the pins from the TinkerKit connector. You can also add external hardware to get more PWM pins if you prefer that option.

nicolopadovandev:
sorry if i’m carrying on this conversation, i just want to be clear

No worries. This is a complex subject so it's not surprising.

What is the name of the hardware? I think that it’s the option that I’m going to prefer in future.

For now I’ll use the library

The PCA9685 looks nice. The problem with that is it is controlled over I2C but only one of the two hardware I2C pins is available on the Esplora. There are some libraries you could use to control it via software I2C.

I also see the TLC5940 and similar chips (some of which are SPI-controlled) but those are constant current LED drivers so I don't know if they are as well suited for your application (though I'm sure you could make them work.

Perhaps someone will chime in with better recommendations. I have only ever used software PWM when I needed more PWM pins.

Guess I’m gonna buy it. For now I’ll use the library that u sent me. Can I continue contacting u on this discussion if I have problems while using the library? Thanks

Sure

How do I use the library? I installed it and included it.
I'm trying to make the 14, 15, 16 (the first 3 pins in the purple boxes that we mentioned) be like the arduino UNO's pins, but I don't understand how

The library comes with a simple usage example you can open at File > Examples > PalatisSoftPWM > PalatisSoftPWM_example.

What you need to do is define 3 channels, each of which is assigned an Arduino pin. Then in your code, you will control the PWM on each of those pins by referring to the channel numbers. In the example, only one channel is defined, on pin 13:

SOFTPWM_DEFINE_PIN13_CHANNEL(0);

You can refer to the documentation for detailed information on any of the libraries functions:

SOFTPWM_DEFINE_PIN14_CHANNEL(0);
SOFTPWM_DEFINE_PIN15_CHANNEL(1);
SOFTPWM_DEFINE_PIN16_CHANNEL(2);
SOFTPWM_DEFINE_OBJECT(3);
const int controlPin1 = 0;
const int controlPin2 = 1;
const int enablePin = 2;

Now if I do
analogWrite(enablePin, HIGH);

the motor should run, correct?
Also in the setup() i've put the PalatisSoftPWM.begin(255); command

nicolopadovandev:
SOFTPWM_DEFINE_PIN14_CHANNEL(0);
SOFTPWM_DEFINE_PIN15_CHANNEL(1);
SOFTPWM_DEFINE_PIN16_CHANNEL(2);
SOFTPWM_DEFINE_OBJECT(3);

Perfect!

nicolopadovandev:
const int enablePin = 2;

Are you sure you need PWM on the enable pin? When I think of an enable pin, I expect it to only need to be set HIGH or LOW using digitalWrite depending on whether I want to enable or disable the motor.

nicolopadovandev:
Now if I do
analogWrite(enablePin, HIGH);

the motor should run, correct?

analogWrite is only for hardware PWM. When using the PalatisSoftPWM library, it would look something like this:

PalatisSoftPWM.set(enablePin, 255);

Also, it doesn't make sense to use HIGH with analogWrite. HIGH is to use with digitalWrite. analogWrite takes a value 0-255.

Yep sorry i need the motor to get different speeds so i need PWM. For the other two pins I can use the digitalWrite bc i need them to be only HIGH or LOW. Can I use the pins as they are by default on the board?