Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arduino Uno #4

Open
thijsforel opened this issue Jan 10, 2019 · 12 comments
Open

Arduino Uno #4

thijsforel opened this issue Jan 10, 2019 · 12 comments

Comments

@thijsforel
Copy link

Hi,

Trying to use the library for the first time. Trying the SimpleDimmer example (provided with the Library) Arduino IDE says:
"Global variables use 2337 bytes (114%) of dynamic memory, leaving -289 bytes for local variables. Maximum is 2048 bytes."
What's up with that?

@VSneg
Copy link
Collaborator

VSneg commented Jan 15, 2019

Hello, please try to rename the library folder on "RBDdimmer" and restart your Arduino IDE !

@rammnco
Copy link

rammnco commented Jan 16, 2019

Hi, i have the same issue.
It seems that the RBDdimmer library alone is too much for the 2KB SRAM of the arduino uno. It uses too many global variables.
With the arduino mega as selected board, which has 8KB it compiles just fine.

Is this library compatible with Uno and Nano boards, as described in the README?

@pcex
Copy link

pcex commented Jan 18, 2019

this works for atmega 328 it only uses arduino library but i need help aswell i want to keep the dim constant where this code fluctuates
`/*
Pin | Interrrupt # | Arduino Platform

2 | 0 | All -But it is INT1 on the Leonardo
3 | 1 | All -But it is INT0 on the Leonardo
18 | 5 | Arduino Mega Only
19 | 4 | Arduino Mega Only
20 | 3 | Arduino Mega Only
21 | 2 | Arduino Mega Only
0 | 0 | Leonardo
1 | 3 | Leonardo
7 | 4 | Leonardo
The Arduino Due has no standard interrupt pins as an iterrupt can be attached to almosty any pin.

In the program pin 2 is chosen
*/
int AC_LOAD = 3; // Output to Opto Triac pin
int dimming = 1024; // Dimming level (0-128) 0 = ON, 128 = OFF

void setup()
{
Serial.begin(115200);
pinMode(AC_LOAD, OUTPUT);// Set AC Load pin as output
attachInterrupt(0, zero_crosss_int, RISING); // Choose the zero cross interrupt # from the table above
}

//the interrupt function must take no parameters and return nothing
void zero_crosss_int() //function to be fired at the zero crossing to dim the light
{
// Firing angle calculation : 1 full 50Hz wave =1/50=20ms
// Every zerocrossing thus: (50Hz)-> 10ms (1/2 Cycle)
// For 60Hz => 8.33ms (10.000/120)
// 10ms=10000us
// (10000us - 10us) / 128 = 75 (Approx) For 60Hz =>65

int dimtime = (65*dimming); // For 60Hz =>65
delayMicroseconds(dimtime); // Wait till firing the TRIAC
digitalWrite(AC_LOAD, HIGH); // Fire the TRIAC
delayMicroseconds(8.33); // triac On propogation delay
// (for 60Hz use 8.33) Some Triacs need a longer period
digitalWrite(AC_LOAD, LOW); // No longer trigger the TRIAC (the next zero crossing will swith it off) TRIAC
}

void loop() {
for (int i=880; i <= 902; i++){
if (i==902){
dimming=0;
delay(100);
}
else{
dimming=i;
Serial.println(i);
delay(5);
}
}

for (int i=902; i >= 880; i--){
if (i==902){
dimming=0;
delay(100);
}
else{
dimming=i;
Serial.println(i);
delay(5);
}
}

}

`

does not run as good as RBD codes on at2560 r3

@Gauthieer
Copy link

Hello !
I have the same issue as mentioned by @thijsforel with my Arduino Uno (with the SimplePotentiometer example) and your "AC Light Dimmer Module".

"Arduino IDE says: Global variables use 2411 bytes (117%) of dynamic memory, leaving -363 bytes for local variables. Maximum is 2048 bytes." So, impossible to compile the sketch.

As asked @rammnco, is this library compatible with Uno and Nano boards, as described in the README ?

Thanks for your help,
Bests.

@JimmyBondi
Copy link

Same here...
I also would like to use this with an ATMega328 based Arduino.

@VSneg
Copy link
Collaborator

VSneg commented Jan 21, 2019

@rammnco @Gauthieer @JimmyBondi
Did you try to rename the library folder on "RBDdimmer"?
Arduino\libraries\RBDdimmer

@rammnco
Copy link

rammnco commented Jan 21, 2019

@VSneg
Yes, I have the folder named that way ("RBDdimmer").
I have tried it with the c and header files directly under this directory too.

Can this really be related to the library name though? The message says its about the global variables leaving no space for local variables...

It seems to be loaded well , because the sketch compiles just fine if I select a board with a bigger SRAM (like Arduino MEGA).
Just the Uno does'nt work, due to it's limited space. Same error mesasge like the others above.

@Gauthieer
Copy link

@VSneg
Yes, like @rammnco, my library folder's name is "RBDdimmer"... I also think it's just because the sketch is to big for Arduino Uno...Have you got a solution for that ?
Thanks.

@JimmyBondi
Copy link

@VSneg
Yes. I also tried it with different IDE Versions. (1.8.5, 1.6.12 and 1.5.8)

@IvanKryukovRBD
Copy link
Collaborator

@JimmyBondi, @Gauthieer, @rammnco, @Gauthieer, @pcex, @thijsforel
We made new libarary please can you try and give us feedback )
https://github.com/RobotDynOfficial/RBDDimmer

@Garithes
Copy link

Auch mit der neuen Version:
Globale Variablen verwenden 2139 Bytes (104%) des dynamischen Speichers, -91 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.
Nicht genug Arbeitsspeicher; unter http://www.arduino.cc/en/Guide/Troubleshooting#size finden sich Hinweise, um die Größe zu verringern.
Fehler beim Kompilieren für das Board Arduino/Genuino Uno.

@GabrielLAPU
Copy link

Hi, I try to connect an Arduino Nano Every but the library don't work with this version of Arduino, anypeople have idea how I can operate with this library in this Arduino Model?
Thanks in advance.
Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants