hi, and some that I do not write in the forum, I would like to know if anybody has already found this error code:
"WInterrupts.c.o (symbol from plugin): In function` attachInterrupt ':
(.text + 0x0): multiple definition of `__vector_1 '
sketch \ sketch_feb26g.ino.cpp.o (symbol from plugin) :(. text + 0x0): first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for the Arduino / Genuino Uno card. "
The project concerns an encoder that counts the cm traveled by a robot and thanks to a shield with LM1881 prints the result on the monitor below the code:
"
//Encoder Kütüphanesi
#include <Encoder.h>
//Encoder Tanımı
Encoder enkoder(2,4);
float cap =26.4; // Diametro albero o ruota sull'encoder (mm)
int pulse=1087; // Numero di impulsi dell'encoder
float uzunluk=0;
long ilkPulse;
const float pi=3.141592;
#include <TVout.h>
#include <fontALL.h>
#include "schematic.h"
#include "LogoElettronicaIn.h"
#define W 136
//#define W 120
#define H 96
TVout TV;
int zOff = 150;
int xOff = 0;
int yOff = 0;
int cSize = 50;
int view_plane = 64;
float angle = PI/60;
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
TV.begin(NTSC, W, H);
// TV.begin(PAL, W, H);
initOverlay();
TV.select_font(font4x6);
unsigned char w,l,wb;
w = pgm_read_byte(LogoElettronicaIn);
l = pgm_read_byte(LogoElettronicaIn+1);
TV.bitmap(12,40,LogoElettronicaIn);
delay(10000);
//fonts
}
void initOverlay() {
TCCR1A = 0;
// Enable timer1. ICES0 is set to 0 for falling edge detection on input capture pin.
TCCR1B = _BV(CS10);
// Enable input capture interrupt
TIMSK1 |= _BV(ICIE1);
// Enable external interrupt INT0 on pin 2 with falling edge.
EIMSK = _BV(INT0);
EICRA = _BV(ISC11);
}
// Required to reset the scan line when the vertical sync occurs
ISR(INT0_vect) {
display.scanLine = 0;
}
void loop() {
TV.println(30,80,"Dist:");
TV.println(70,80,analogRead(A0));
// read the input on analog pin 0:
// print out the value you read:
delay(1); // delay in between reads for stability
TV.clear_screen();
{
long sonPulse = enkoder.read();
if (sonPulse != ilkPulse)
{
ilkPulse = sonPulse;
float cevre = cap*pi;
float hesap = cevre/pulse;
uzunluk = sonPulse*hesap;
Serial.print(sonPulse);
Serial.print(" -- ");
Serial.print(uzunluk);
Serial.println(" mm");
}
}}
"