Интерфейс датчика импульсов и РЧ передатчик и приемник с Arduino
Я написал следующий код для взаимодействия Arduino с РЧ передатчиком и приемником и датчиком импульсов с помощью примеров кодов, но я получаю ошибку компиляции, как это
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,- gc-section -mmcu=atmega328p -o "C:\Users\rahul\AppData\Local\Temp\arduino_build_465959/tx_pulse.ino.elf" "C:\Users\rahul\AppData\Local\Temp\arduino_build_465959\sketch\tx_pulse.ino.cpp.o" "C:\Users\rahul\AppData\Local\Temp\arduino_build_465959\library \PulseSensor_Playground\PulseSensorPlayground.cpp.o" "C:\Users\rahul\AppData\Local\Temp\arduino_build_465959\ библиотеки \ PulseSensor \ полезности \ PulseSensor_layground cpp.o "" C: \ Users \ rahul \ AppData \ Local \ Temp \ arduino_build_465959 \ library \PulseSensor_Playground\utility\PulseSensorSerialOutput.cpp.o" "C:\Users\rahul\AppData\Local\Temp\arduino_build_465959 библиотеки PulseSensor_Playground\utility\PulseSensorTimingStatistics.cpp.o" "C:\Users\rahul\AppData\Local\Temp\arduino_build_465959\ библиотеки \VirtualWire\VirtualWire.cpp.o" "C:\Users\rahul\AppData\Local\Temp\arduino_build_465959/..\arduino_cache_660487\ ядро \core_arduino_avr_uno_0c812875ac70eb4a9b385d8fb077f54c.a" "-LC:\Users\rahul\AppData\Local\Temp\arduino_build_465959" -lm C:\Users\rahul\AppData\Local\Temp\arduino_build_465959\ библиотеки \ VirtualWire \ VirtualWire из VirtualWire.cppo. плагин): в функции
crc16_update(unsigned int, unsigned char)': (.text+0x0): multiple definition of
__vector_11'C: \ Users \ rahul \ AppData \ Local \ Temp \ arduino_build_465959 \ sketch \ tx_pulse.ino.cpp.o (символ из плагина):(. Text+0x0): сначала определено здесь
collect2.exe: ошибка: ld вернул 1 состояние выхода
Использование библиотеки PulseSensor_Playground версии 1.4.3 в папке: C:\Users\rahul\OneDrive\Documents\Arduino\library \ PulseSensor_Playground Использование библиотеки VirtualWire в папке: C:\Users\rahul\OneDrive\Documents\Arduino\library \VirtualWire (legacy) состояние выхода 1 Ошибка компиляции для платы Arduino/Genuino Uno.
И мой код:
#define USE_ARDUINO_INTERRUPTS true // Set-up low-level interrupts for most acurate BPM math.
#include <PulseSensorPlayground.h> // Includes the PulseSensorPlayground Library.
#include <VirtualWire.h>
const int led_pin = 13;
const int transmit_pin = 12;
const int receive_pin = 2;
const int transmit_en_pin = 3;
// Variables
const int PulseWire = 0; // PulseSensor PURPLE WIRE connected to
ANALOG PIN 0
int Threshold = 550; // Determine which Signal to "count as a beat" and which to ignore.
// Use the "Gettting Started Project" to fine-tune Threshold Value beyond default setting.
// Otherwise leave the default "550" value.
PulseSensorPlayground pulseSensor; // Creates an instance of the
PulseSensorPlayground object called "pulseSensor"
void setup()
{
// Initialise the IO and ISR
vw_set_tx_pin(transmit_pin);
vw_set_rx_pin(receive_pin);
vw_set_ptt_pin(transmit_en_pin);
vw_set_ptt_inverted(true); // Required for DR3100
vw_setup(2000); // Bits per sec
pinMode(led_pin, OUTPUT);
Serial.begin(9600); // For Serial Monitor
// Configure the PulseSensor object, by assigning our variables to it.
pulseSensor.analogInput(PulseWire);
//pulseSensor.blinkOnPulse(LED13); //auto-magically blink Arduino's LED with heartbeat.
pulseSensor.setThreshold(Threshold);
// Double-check the "pulseSensor" object was created and "began" seeing a signal.
/*if (pulseSensor.begin()) {
Serial.println("We created a pulseSensor Object !"); //This prints one time at Arduino power-up, or on Arduino reset.
}*/
}
byte count = 1;
void loop()
{
int myBPM = pulseSensor.getBeatsPerMinute(); // Calls function on our pulseSensor object that returns BPM as an "int".
// "myBPM" hold this BPM value now.
if (pulseSensor.sawStartOfBeat()) { // Constantly test to see if "a beat happened".
Serial.println("♥ A HeartBeat Happened ! "); // If test is "true", print a message "a heartbeat happened".
Serial.print("BPM: "); // Print phrase "BPM: "
Serial.println(myBPM); // Print the value inside of myBPM.
char msg[] = {myBPM,' ','#'};
msg[3] = count;
digitalWrite(led_pin, HIGH); // Flash a light to show transmitting
vw_send((uint8_t *)myBPM, 4);
vw_wait_tx(); // Wait until the whole message is gone
digitalWrite(led_pin, LOW);
delay(1000);
count = count + 1;
}
}