Zaczynam zabawę w Arduino, mam ProMini , AT328,5V,16MHz.
Do tego wpadł mi wyswietlacz P10(1r) V706, taki Chińczyk.
Po napisaniu programu w zasadzie wszystko działało, ale zachciało mi się
wyswietlanie umieścić w przerwaniu, no i zaczęły się problemy.
Komunikat podczas kompilacji
libraries\DMD2\DMD2_Timer.cpp.o (symbol from plugin): In function `__vector_13':
(.text+0x0): multiple definition of `__vector_13'
libraries\Timer1\TimerOne.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
Błąd kompilacji dla płytki Arduino Pro or Pro Mini.
Czy to wina płytki ProMini czy tez biblioteka TimetOne.h ?
Kod: Zaznacz cały
#include <TimerOne.h>
#include <Time.h>
#include <TinyGPS++.h>
#include <Arial_Black_16.h>
#include <DMD2.h>
//#include <SPI.h>
#define Serial_GPS Serial
static const uint32_t GPSBaud = 9600;
byte hh=12;
byte mm=47;
int ss=1968;
String MESSAGE=" "+String(hh)+":"+String(mm);//+"/"+String(ss);
TinyGPSPlus gps;
const int WIDTH = 1;// Ile masz paneli polaczonych szeregowo ?
SoftDMD dmd(WIDTH,1); // DMD kontroluje caly panel
DMD_TextBox box(dmd); // "box" provides a text box to automatically write to/scroll the display
void pokaz(void);
//*************** SETUP ******************
void setup()
{
Timer1.initialize(5000);// w mikrosekundach od 1 do 8388480 ( 8,4s) 5000us to 5 ms
Timer1.attachInterrupt(pokaz);
dmd.setBrightness(255);
dmd.selectFont(Arial_Black_16); // Font used
dmd.begin();
box.print("..Init"); // Display TEXT
delay (500);
dmd.clearScreen();
Serial.begin(9600);
Serial_GPS.begin(GPSBaud); // Start GPS Serial Connection
}
//*************** PETLA ******************
void loop()
{
GPS_Timez(); // wywolanie GPS_Timez
}
void GPS_Timez(){
// while (Serial_GPS.available()) {
// if (gps.encode(Serial_GPS.read())) {
// int Year = gps.date.year();
// byte Month = gps.date.month();
// byte Day = gps.date.day();
// byte Hour = gps.time.hour();
// byte Minute = gps.time.minute();
// byte Second = gps.time.second();
}
void pokaz()
{
// a tu trzeba wkleic procedure wyswietlania
box.print(MESSAGE);
}