Go Down

Topic: Problem with Arduino Esplora pins (Read 1 time) previous topic - next topic

nicolopadovandev

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!
I'm just trying to send a rocket controlled by arduino to the space and back. Hi Elon Musk.

pert

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.

nicolopadovandev

Sorry, what do you mean with "purple"? There aren't any purple boxes in my diagram...which one do you mean? Thank you
I'm just trying to send a rocket controlled by arduino to the space and back. Hi Elon Musk.

pert

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.

nicolopadovandev

#4
Jan 08, 2019, 10:44 pm Last Edit: Jan 08, 2019, 10:47 pm by nicolopadovandev
It doesn't work.... Maybe I've done something wrong on the breadboard..?
I'm just trying to send a rocket controlled by arduino to the space and back. Hi Elon Musk.

nicolopadovandev

#5
Jan 08, 2019, 10:57 pm Last Edit: Jan 09, 2019, 11:37 pm by Coding Badly
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.

Code: [Select]

#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: [code] [/code] tags added.
I'm just trying to send a rocket controlled by arduino to the space and back. Hi Elon Musk.

pert

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:
https://github.com/per1234/PalatisSoftPWM

engine/motor (idk which is correct in English)
Motor is most correct.

nicolopadovandev

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:
I'm just trying to send a rocket controlled by arduino to the space and back. Hi Elon Musk.

pert

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

nicolopadovandev's picture:

nicolopadovandev

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
I'm just trying to send a rocket controlled by arduino to the space and back. Hi Elon Musk.

pert

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.

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.

nicolopadovandev

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
I'm just trying to send a rocket controlled by arduino to the space and back. Hi Elon Musk.

pert

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.

nicolopadovandev

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
I'm just trying to send a rocket controlled by arduino to the space and back. Hi Elon Musk.


Go Up