This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

  • 1 voto(s) - 5 Media
  • 1
  • 2
  • 3
  • 4
  • 5
proramacion con arduino
#1
Tengo el siguiente detalle con las liberias o algo relacionado con eso:

//Declaramos librerias que se usarán en el programa
#include <pt.h>//libreria protothread
#include <DHT.h>//libreria del sensor de temperatura
#include <DHT_U.h>
#include <Wire.h>//libreria para enlace i2c
#include <Adafruit_GFX.h>//Libreria para pantalla oled
#include <Adafruit_SH1106.h>//libreria para pantalla oled
#include <RTClib.h>//libreria para el RTC
#include <Servo.h>//libreria para los servos
#include "MAX30105.h"//libreria pulsometro
#include "heartRate.h"//libreria
#define USE_ARDUINO_INTERRUPTS true   
#include <PulseSensorPlayground.h>//LIBRERIA DEL SENSOR DE PULSO CARDIACO 2


esas son todas las liberias que estamos usando y me marca el siguiene error:

exit  status 1
error compilado para la tarjeta arduino mega

Nos hemos percatado que si ponemos en comentarios alguna de estas dos librerias el programa si compila pero no podemos usar la libreria
en comentarios como podemos solucionarlo?

#include <pt.h>//libreria protothread
#include <DHT.h>//libreria del sensor de temperatura
#include <DHT_U.h>
#include <Wire.h>//libreria para enlace i2c
#include <Adafruit_GFX.h>//Libreria para pantalla oled
#include <Adafruit_SH1106.h>//libreria para pantalla oled
#include <RTClib.h>//libreria para el RTC
#include <Servo.h>//libreria para los servos
#include "MAX30105.h"//libreria pulsometro
#include "heartRate.h"//libreria
#define USE_ARDUINO_INTERRUPTS true   
//#include <PulseSensorPlayground.h>//LIBRERIA DEL SENSOR DE PULSO CARDIACO 2
  Responder
#2
Buenos días

Lo primero que tienes que comprobar es que tengas instaladas todas las librerías, y que el programa las admita, tiene que estar el nombre antes del punto en tonos verdes o rojos. Si tienes algún nombre en negro, es que no tienes instalada esa librería

después tienes que darte cuenta de que estas usando dos librerías para el mismo sensor

Código:
#include <DHT.h>//libreria del sensor de temperatura
#include <DHT_U.h>

Tienes que usar solo una, yo usaría la primera

Lo mismo para la pantalla oled

Código:
#include <Adafruit_GFX.h>//Libreria para pantalla oled
#include <Adafruit_SH1106.h>//libreria para pantalla oled

Dependiendo del modelo de pantalla utiliza una o la otra, las dos no.

si las librerías están entre los signos menor que y mayor que, <Xx.h>, significa que están en un lugar concreto, normalmente en la carpeta librerías que usa el propio IDE Arduino

C:\Users\"nombre usuario"\Documents\Arduino\libraries

Si las librerías están entre comillas "Xx.h", significa que pueden estar en cualquier lugar, carpeta, unidad, u otro medio del equipo, (incluidos USB) y tarda mas en encontrarlas.
Por lo tanto, es un consejo no una obligación, debes elegir donde se encuentran las librerías para que estén todas juntas y el IDE tarde menos en encontrarlas.

Si el error es tan seco como indicas y no dice nada mas, 

exit  status 1

error compilado para la tarjeta arduino mega

Debes comprobar en el IDE que Arduino tienes seleccionado, en el recuadro herramientas, placa, debe corresponder con la que estas utilizando

"Arduino Mega 2560"

Y también el procesador

""ATMega 2560(Mega2560)"

Comprueba todo esto y me dices.

No estaría mal que subieras el programa completo, para ver si hay algún fallo mas, y también que copiaras los errores del IDE, para ver todo lo que dice

Un saludo.
  Responder
#3
El ejemplo siguiente lo tome de arduino y me maca el mismo error:


libraries\Servo\avr\Servo.cpp.o (symbol from plugin): In function `ServoCount':
(.text+0x0): multiple definition of `__vector_17'
sketch\PulseSensor_Servo.ino.cpp.o (symbol from plugin)Triste.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compilando para la tarjeta Arduino Mega or Mega 2560.



Include Servo.h BEFORE you include PusleSensorPlayground.h
*/
#include <Servo.h>

/*
  Every Sketch that uses the PulseSensor Playground must
  define USE_ARDUINO_INTERRUPTS before including PulseSensorPlayground.h.
  Here, #define USE_ARDUINO_INTERRUPTS true tells the library to use
  interrupts to automatically read and process PulseSensor data.

  See ProcessEverySample.ino for an example of not using interrupts.
*/
#define USE_ARDUINO_INTERRUPTS true
#include <PulseSensorPlayground.h>

/*
  The format of our output.

  Set this to PROCESSING_VISUALIZER if you're going to run
    the Processing Visualizer Sketch.
    See https://github.com/WorldFamousElectronic...Visualizer

  Set this to SERIAL_PLOTTER if you're going to run
    the Arduino IDE's Serial Plotter.
*/
const int OUTPUT_TYPE = SERIAL_PLOTTER;

/*
  Pinout:
    PULSE_INPUT = Analog Input. Connected to the pulse sensor
      purple (signal) wire.
    PULSE_BLINK = digital Output. Connected to an LED (and 220 ohm resistor)
      that will flash on each detected pulse.
    PULSE_FADE = digital Output. PWM pin onnected to an LED (and resistor)
      that will smoothly fade with each pulse.
      NOTE: PULSE_FADE must be a pin that supports PWM. Do not use
      pin 9 or 10, because those pins' PWM interferes with the sample timer.
*/
const int PULSE_INPUT = A0;
const int PULSE_BLINK = 13;    // Pin 13 is the on-board LED
const int PULSE_FADE = 5;
const int THRESHOLD = 550;  // Adjust this number to avoid noise when idle

/*
  All the PulseSensor Playground functions.
*/
PulseSensorPlayground pulseSensor;

/*
  Make a heart servo, the pin to control it with, and a servo position variable
*/
Servo heart;
const int SERVO_PIN = 6;
int pos = 90;

void setup() {
  /*
    Use 115200 baud because that's what the Processing Sketch expects to read,
    and because that speed provides about 11 bytes per millisecond.

    If we used a slower baud rate, we'd likely write bytes faster than
    they can be transmitted, which would mess up the timing
    of readSensor() calls, which would make the pulse measurement
    not work properly.
  */
  Serial.begin(115200);
  // set up the heart servo on SERVO_PULSE
  // set servo position to pos (90 degrees, mid position)
  heart.attach(SERVO_PIN);
  heart.write(pos);

  // Configure the PulseSensor manager.
  pulseSensor.analogInput(PULSE_INPUT);
  pulseSensor.blinkOnPulse(PULSE_BLINK);
  pulseSensor.fadeOnPulse(PULSE_FADE);

  pulseSensor.setSerial(Serial);
  pulseSensor.setOutputType(OUTPUT_TYPE);
  pulseSensor.setThreshold(THRESHOLD);

  // Now that everything is ready, start reading the PulseSensor signal.
  if (!pulseSensor.begin()) {
    /*
      PulseSensor initialization failed,
      likely because our particular Arduino platform interrupts
      aren't supported yet.

      If your Sketch hangs here, try changing USE_ARDUINO_INTERRUPTS to false.
      which doesn't use interrupts.
    */
    for(;Guiño {
      // Flash the led to show things didn't work.
      digitalWrite(PULSE_BLINK, LOW);
      delay(50);
      digitalWrite(PULSE_BLINK, HIGH);
      delay(50);
    }
  }
}

void loop() {
  /*
    Wait a bit.
    We don't output every sample, because our baud rate
    won't support that much I/O.
  */
  delay(20);

  // write the latest sample to Serial.
  pulseSensor.outputSample();

  // write the latest analog value to the heart servo
  moveServo(pulseSensor.getLatestSample());

  /*
    If a beat has happened since we last checked,
    write the per-beat information to Serial.
  */
  if (pulseSensor.sawStartOfBeat()) {
    pulseSensor.outputBeat();
  }
}

/*
  Map the Pulse Sensor Signal to the Servo range
  Pulse Sensor = 0 <> 1023
  Servo = 0 <> 180
  Modify as you see fit!
*/
void moveServo(int value){
  pos = map(value,0,1023,0,180);
  heart.write(pos);
}
  Responder
#4
Céntrate en un código solo para que te pueda ayudar, si pones códigos distintos, no hacemos nada.

Y adjúntalos como código, no tengo porque quitar los emojis que no sirven para nada en un código de Arduino.
  Responder