RobotDynOfficial / RBDDimmer

The following library is used for work with dimmer, it gives ability to control large ammoun of dimmer. This lib uses with Leonardo, Mega, UNO, ESP8266, ESP32, Arduino M0, Arduino Zero, Arduino Due, STM32.
236 stars 111 forks source link

arduino nano compile error #23

Open carloperatoner opened 4 years ago

carloperatoner commented 4 years ago

I have an issue with an Arduino nano that I am using to control a laser cutter chiller. The nano has two temperature probes, a flow sensor and a triac board for control of the cooling fan. I am using D6 for the temperature probes (no interrupt needed) D2 for the zerocrossing input (interrupt 0) for the triac and D4 for the control line and D3 (interrupt 1) for the flow sensor.

This is the compile error I receive: WInterrupts.c.o (symbol from plugin): In function attachInterrupt': (.text+0x0): multiple definition of__vector_1' libraries\RBDDimmer-master\avr\RBDmcuAVR.cpp.o (symbol from plugin):(.text+0x0): first defined here collect2.exe: error: ld returned 1 exit status exit status 1 Error compiling for board Arduino Nano.

It relates to this line in my code assigning the interrupt to for the flow sensor.

attachInterrupt(1,Flow,RISING);

Full code is listed below:

include // LCD Library

include // Temp Sensor Library

include // Temp Sensor Library

include // Fan Control Library

define USE_SERIAL Serial

// Setup temperature sensors

define ONE_WIRE_BUS 6 // Connection for temperature probes pin 6

OneWire oneWire(ONE_WIRE_BUS); DallasTemperature sensors(&oneWire); double inputtemp; double outputtemp; double deltatemp;

// Setup LCD LiquidCrystal lcd(12, 11, 10, 9, 8, 7); // LCD Setup

// Setup Flow Sensor int flowpin = 3; // Connection for flow sensor double flowrate; volatile int count; double flowpulse = 2.25; //flow rate per pulse 2.25ml

// Setup Fan Speed Control

define fancontrolPin 4

define zerocross 2

dimmerLamp dimmer(fancontrolPin);

void setup(void) { Serial.begin(9600); //Begin serial communication Serial.println("Arduino Digital Temperature // Serial Monitor Version"); // Startup message for Temperature sensors.begin();

pinMode(flowpin, INPUT_PULLUP); // Setup flow sensor configuration attachInterrupt(1,Flow,RISING);

dimmer.begin(NORMAL_MODE, ON); //Setup Fan control state dimmer.setPower(10); }

void loop(void) { // Flow Sensor Setup count = 0; // Set flow rate counter interrupts();

// Temperature Sensor Routine sensors.requestTemperatures();
inputtemp = sensors.getTempCByIndex(0); outputtemp = sensors.getTempCByIndex(1); deltatemp = outputtemp - inputtemp;

lcd.begin(16, 2); lcd.print(" In / Out Flow"); lcd.setCursor(0, 1); lcd.print(inputtemp,1); // Input Temperature to LCD Serial.println("Input Temp: "); Serial.println(inputtemp); // Input Temperature to Serial

lcd.print("/"); lcd.print(outputtemp,1); // Output Temperature to LCD Serial.println("Output Temp: "); Serial.println(outputtemp); // Output temperature to Serial

noInterrupts();

// Flow Sensor Routine flowrate = ((count flowpulse 60) / 1000); // Convert pulses to Liters/Minute

lcd.print(" "); lcd.print(flowrate,1); // Output flowrate to LCD Serial.println("Flow Rate: "); Serial.println(flowrate); // Output flowrate to Serial

if (deltatemp >= 10) { deltatemp = 10; }

if (deltatemp <= 0) { deltatemp = 0; } dimmer.setPower(int(deltatemp * 10)); delay(1000); //Update value every 1 sec. }

void Flow() { // Count flow sensor pulses count++; }

Any suggestions? It seems that the library attaches to both pins for interrupts.

Thanks in advance.

WInterrupts.c.o (symbol from plugin): In function `attachInterrupt':

(.text+0x0): multiple definition of `__vector_1'

libraries\RBDDimmer-master\avr\RBDmcuAVR.cpp.o (symbol from plugin):(.text+0x0): first defined here

collect2.exe: error: ld returned 1 exit status

exit status 1 Error compiling for board Arduino Nano.

fabianoriccardi commented 4 years ago

Hi carloperatoner, May you try this library on Arduino Nano? It is an alternative solution to control dimmers

carloperatoner commented 4 years ago

Thank you. I used the library and it worked.

Get Outlook for Androidhttps://aka.ms/ghei36


From: Fabiano Riccardi notifications@github.com Sent: Tuesday, October 29, 2019 1:44:29 PM To: RobotDynOfficial/RBDDimmer RBDDimmer@noreply.github.com Cc: carloperatoner carloperatoner@hotmail.com; Author author@noreply.github.com Subject: Re: [RobotDynOfficial/RBDDimmer] arduino nano compile error (#23)

Hi carloperator, May you try this libraryhttps://github.com/fabiuz7/Dimmable-Light-Arduino on Arduino Nano? It is an alternative solution to control dimmers

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/RobotDynOfficial/RBDDimmer/issues/23?email_source=notifications&email_token=ALGYGPQV5E63W7W4CZMRPNLQRBY73A5CNFSM4JAKWPC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECROMWA#issuecomment-547546712, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALGYGPVTNXMCS3TF5KKNWVTQRBY73ANCNFSM4JAKWPCQ.

Tutotrial commented 2 years ago

can i set the lamp brightness if i use these library? thank you @fabianoriccardi

fabianoriccardi commented 2 years ago

can i set the lamp brightness if i use these library?

Yes of course!

Tutotrial commented 2 years ago

In function dimmerLamp::dimmerLamp(int)': (.text+0x0): multiple definition of__vector_5'

please help me about this problem. thanks

Tutotrial commented 2 years ago

can i try this library on Arduino Mega? thanks

Tutotrial commented 2 years ago

@fabianoriccardi

fabianoriccardi commented 2 years ago

May you tell me the version (or the commit) of the library and the target board?