GithubHelp home page GithubHelp logo

robotdynofficial / rbddimmer Goto Github PK

View Code? Open in Web Editor NEW
234.0 234.0 109.0 81 KB

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.

C++ 82.23% C 17.77%

rbddimmer's Introduction

rbddimmer's People

Contributors

ivankryukovrbd avatar robotdyn avatar vsneg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rbddimmer's Issues

How to Install this on ESP8266

Hello, I am not familiar with this project. How can I initialize this library to my nodemcu ESP8266, and what firmware is necessary to use this? Thank you

Relay not opening

I'm using a dual dimmer, but non of the relays are opening up. got two dimmer...same problem on both

with the testprogram I can set power, values and read them. blue LEDs are 'on' value 1
I get the set value back, but nothing is happening on the line output (LEDs aren't on and of course no light either)

also have issues when I implement the code into my program, seems to jam everything (get no values on the screen anymore ) which somewhat makes the communication a bit tricky :-)

if someone out there could help, would be most appreciated

regards

Help

WInterrupts.c.o (symbol from plugin): In function attachInterrupt': (.text+0x0): multiple definition of __vector_5'
libraries/RBDDimmer-master/avr/RBDmcuAVR.cpp.o (symbol from plugin):(.text+0x0): first defined here
Несколько библиотек найдено для "RBDdimmer.h"
Используется: /home/user/Arduino/libraries/RBDDimmer-master
Не используется: /home/user/Arduino/libraries/_RBDdimmer
/home/user/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld: Disabling relaxation: it will not work with multiple definitions
collect2: error: ld returned 1 exit status
exit status 1
Ошибка компиляции для платы Arduino Mega or Mega 2560.

Dimmer Output is Dimmed during Serial Print

Hello
A call to Serial Print causes the dimmer output to vary, see youtube video https://youtu.be/p16r6WQFRaE code below:

// Dimmer Stuff
#include <RBDdimmer.h>

#define DIMMER_OUTPUT_PIN 3
#define DIMMER_ZERO_CROSSING_PIN 2 // for boards with CHANGEBLE input pins

dimmerLamp TheDimmer( DIMMER_OUTPUT_PIN ); //initialase port for dimmer for UNO/NANO

// Loop timer stuff
#define PRINT_RATE_MILLS 1000
unsigned long PrintMillis = 0;

// -------------------------------------- setup() ---------------------------------
void setup()
{ // Do setup stuff
Serial.begin ( 9600 ); // Setup Serial

TheDimmer.begin( NORMAL_MODE , ON ); // Setup Dimmer Mode
TheDimmer.setPower( 25 ); // Set Lamp Power
}

// --------------------------------------- loop() -----------------------------------
void loop()
{ // Do forever stuff

if( ( unsigned long)( millis() - PrintMillis ) >= PRINT_RATE_MILLS )
{
PrintMillis = millis(); // update time
Serial.println( "---------------------- Dim The Dimmer ---------------------------" );
}

delay( 1 );
}

Use with Metro M0 adafruit

Hi RobotDyn, we are using at this moment your module in a covid project but we have a problem with it.

We are using an arduino Metro M0 from adafruit and it dont works as expected. I think that the problem its related to the timmer TC3 configuration, as it doesnt interrupt at 100ms.

Under oscilloscope we could see that the Dimmer set the Triac correctly to the OFF position in the width choosed by code (dimmer.setPower(X)), but it goes up again suddenly. So i guess that the TC3 timmer its going really so fast and dont cover the AC sinusoide completly.

As you see on the following photo, the violet signal should cover the rest of the sinusoide.

Thanks for your help.
imagen

BLUE: AC sinusoide output of dimmer.
Yelow: Under the Blue sinusoide, AC MAINLANE
Violet: Control Dimmer signal.

Interrupt Problem with arduino uno

hello,
i try to attach an interrupt on pin3 (pin 2 is used for zerocrossin)
but the compilers says:
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
Fehler beim Kompilieren für das Board Arduino/Genuino Uno.

can someone help me to use the second interrupt on pin3 ?

ESP32 : code source works ?

Hi, I used tu use this robotdyn dimmer with an esp8266 (wemos)
Yet, I change for a ttgo-t-display (esp32)
In RBDmcuESP32.cpp, I see line 6 was corrected : value true (same as in esp8266.h)
But line 61 or so :

void dimmerLamp::ext_int_init(void)
{
int inPin = dimZCPin[this->current_num];
pinMode(inPin, INPUT_PULLUP);
attachInterrupt(inPin, isr_ext, RISING);
}

Do I have to change for Falling or CHANGE ????

Last question : ALLdimmers is define at 50 or 30 (depends if it's in RBDXX.h or .cpp (value of 20 for 8266) Do I hve to change this value and by which one ? And someone can explain me what's the purpose of this value ?

I ask those questions, because I use a load of 2200W, and if I set the dimmer to 50%, the power raises to 1700W !!! not normal. it should be 1100W, or I don't understand the purpose of the dimmer.

Thank you.

Hello Everyone can someone help me. How to use RBDDIMMER with Sinricpro

Hello Everyone,,,
"So lets talk about my Project"

Wifi Module: ESP8266 E-09
Server using Sinric Pro;

In my project, I am controlling, 2 Relays: ON/OFF
And RobotDyn 1 Channel dimmer module for Fan Regulation.

Here is Codes:

#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <SinricPro.h>
#include <SinricProSwitch.h>
#include <SinricProDimSwitch.h>
#include <RBDdimmer.h>

#define SSID          ""                                              // WiFi SSID
#define PASS          ""                                              // WiFi Password

#define APPKEY        ""                                              // SinricPro AppKey
#define APPSECRET     ""                                              // SinricPro AppSecret

#define RELAY1_ID     ""                                              // SinricPro deviceId for relay1
#define RELAY2_ID     ""                                              // SinricPro deviceId for relay2
#define DIMSWITCH_ID  ""                                              // SinricPro deviceId for dimmer

#define RELAY1_PIN  D0                                                // PIN relay1 is connected to
#define RELAY2_PIN  D1                                                // PIN relay2 is connected to
#define DIMMER_PIN  D5                                                // PIN dimmer is connected to
#define ZEROCROSS   D6                                                // for boards with CHANGEBLE input pins

dimmerLamp dimmer(DIMMER_PIN, ZEROCROSS);                             //initialase port for dimmer for ESP8266, ESP32, Arduino due boards

SinricProSwitch &relay1       = SinricPro[RELAY1_ID];                 // declare SinricPro device for relay1 and add the device to SinricProSDK
SinricProSwitch &relay2       = SinricPro[RELAY2_ID];                 // declare SinricPro device for relay2 and add the device to SinricProSDK
SinricProDimSwitch &dimSwitch = SinricPro[DIMSWITCH_ID];              // declare SinricPro device for dimmer and add the device to SinricProSDK                

int  dimLevel = 100;     // keeps the current dimming value (0..100) | initialized to 100 at start
bool pwrState = false;  // keeps the dimmer on/off state            | initialized to false (which means off) at start

// callback for onPowerState (relay1)
bool onPowerStateRelay1(const String& deviceId, bool &state) {
  digitalWrite(RELAY1_PIN, state);                                    // turn RELAY1_PIN on/off (depending on state parameter)
  Serial.printf("[Relay1]: turn %s\r\n", state ? "on" : "off");       // just some output on serial monitor
  return true;
}

// callback for onPowerState (relay2)
bool onPowerStateRelay2(const String& deviceId, bool &state) {
  digitalWrite(RELAY2_PIN, state);                                    // turn RELAY1_PIN on/off (depending on state parameter)
  Serial.printf("[Relay2]: turn %s\r\n", state ? "on" : "off");       // just some output on serial monitor
  return true;
}

// callback for onPowerState (dimmer)
bool onPowerStateDimSwitch(const String& deviceId, bool &state) {
  pwrState = state;                                                   // store the requested state in global variable (this state will be used in onPowerLevelDimSwitch )
  dimmer.setPower(pwrState? dimLevel : 0);
  Serial.printf("[DimSwitch]: turn %s (level: %d)\r\n",               // just some output on serial monitor
                state ? "on" : "off", dimLevel);
  return true;
}

// callback for onPowerLevel (dimmer)
bool onPowerLevelDimSwitch(const String &deviceId, int &level) {
  dimLevel = level;                                                   // store requested level in global variable (this state will be used in onPowerStateDim )
  dimmer.setPower(level);
  Serial.printf("[DimSwitch]: set level %d (state: %s)\r\n",          // just some output on serial monitor
                level, pwrState ? "on" : "off");
  return true;
}

// setup part for pin initialization (just to keep setup() nice and clean)
void setupPins() {
  pinMode(RELAY1_PIN, OUTPUT);                                        // initialize RELAY1_PIN as OUTPUT
  pinMode(RELAY2_PIN, OUTPUT);                                        // initialize RELAY2_PIN as OUTPUT
  dimmer.begin(NORMAL_MODE, ON);                                      //dimmer initialisation: name.begin(MODE, STATE)
}

// setup part for connecting to WiFi (just to keep setup() nice and clean)
void setupWiFi() {
  Serial.printf("[WiFi]: Connecting to %s", SSID);                    // print to which WiFi we are trying to connect to
  WiFi.begin(SSID, PASS);                                             // start connecting to WiFi
  while (WiFi.status() != WL_CONNECTED) {                             // wait until WiFi has been connected
    Serial.printf(".");                                               //    meanwhile print a dot
    delay(250);                                                       //    every 250ms  
  }
  Serial.printf("connected\r\n");                                     // print to serial that we are connected to wifi now
}

// setup part for SinricProSDK (just to keep setup() nice and clean)
void setupSinricPro() {
  relay1.onPowerState(onPowerStateRelay1);                            // assign onPowerStateRelay1 callback function to relay1 device
  relay2.onPowerState(onPowerStateRelay2);                            // assign onPowerStateRelay2 callback function to relay2 device
  dimSwitch.onPowerState(onPowerStateDimSwitch);                      // assign onPowerStateDimSwitch callback function to dimSwitch device
  dimSwitch.onPowerLevel(onPowerLevelDimSwitch);                      // assign onPowerLevelDimSwitch callback function to dimSwitch device

  SinricPro.onConnected([]() {                                        // instead of writing a full callback function we use a lambda function which get called when ESP is connected to SinricPro
    Serial.printf("[SinricPro]: Connected\r\n");                      // and this function does: output to serial "[SinricPro]: Connected"
  });

  SinricPro.onDisconnected([]() {                                     // instead of writing a full callback function we use a lambda function which get called when ESP is disconnected from SinricPro
    Serial.printf("[SinricPro]: Disconnected\r\n");                   // and this function does: output to serial "[SinricPro]: Disconnected"
  });

  SinricPro.begin(APPKEY, APPSECRET, "testws.sinric.pro");                                 // initialize SinricProSDK with APPKEY and APPSECRET
}

void setup() {
  Serial.begin(115200);                                               // initialize Serial to baudrate 115200
  Serial.println();                                                   // print a single line (to get rid of the junk)
  setupPins();                                                        // call setupPin function
  setupWiFi();                                                        // call setupWiFi function
  setupSinricPro();                                                   // call setupSinricPro function
}

void loop() {
  SinricPro.handle();                                                 // do the magic...
}

Code compiling with zero error no any issues in compelling:
the only problem is the codes,the not running in my ESP8266

My serial monitor details are given below here:

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 3584, room 16
tail 0
chksum 0xb0
csum 0xb0
v2843a5ac
~ld

ISR not in IRAM!

User exception (panic/abort/assert)
--------------- CUT HERE FOR EXCEPTION DECODER ---------------

Abort called

stack>>>

ctx: cont
sp: 3ffffec0 end: 3fffffc0 offset: 0000
3ffffec0: feefeffe feefeffe feefeffe feefeffe
3ffffed0: 000000fe 00000000 00000000 00000000
3ffffee0: 00000000 00000000 00000000 00ff0000
3ffffef0: 5ffffe00 5ffffe00 feefeffe 00000000
3fffff00: 00000002 00000005 00000005 4020e36e
3fffff10: 40100816 feefeffe feefeffe 4020e380
3fffff20: 4020f31d 3fff0e54 00000005 4020e889
3fffff30: 00000000 00000000 535b000a 4020ef99
3fffff40: 3ffe89b1 4020f501 ffffffff 3ffef4e4
3fffff50: 3fffdad0 00000000 00000005 4020e938
3fffff60: 4020c5f8 3ffef38c 3ffe89af 4020c471
3fffff70: 4020c5f8 3ffef38c 3ffeeeb0 4020c4aa
3fffff80: 3fffdad0 00000000 3ffef38c 402020b8
3fffff90: 3fffdad0 00000000 3ffef38c 40202c71
3fffffa0: feefeffe feefeffe 3ffef4a4 4020df20
3fffffb0: feefeffe feefeffe 3ffe8500 40101111
<<<stack<<<

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 3584, room 16
tail 0
chksum 0xb0
csum 0xb0
v2843a5ac
~ld

ISR not in IRAM!

User exception (panic/abort/assert)
--------------- CUT HERE FOR EXCEPTION DECODER ---------------

Abort called

stack>>>

Can someone tell me about the Exception Decoder...

RBDDimmer and MAX6675, Reboot itself

Hi, everybody,
When I use just one function to set dimmer power everything works fine, but when I add another function on the loop like read temperature with Max6675 then Arduino seems to reinitialize every 10 seconds.

That's my code:

//Libraries
#include <RBDdimmer.h>//https://github.com/RobotDynOfficial/RBDDimmer
#include "max6675.h"
//Parameters
const int zeroCrossPin = 2;
const int acdPin = 3;
int power = 0;
dimmerLamp acd(acdPin);

//Temp sensor
int SO = 12;
int CS = 11;
int sck = 13;
MAX6675 module(sck, CS, SO);
float temperature = 25;

void setup() {
//Init Serial USB
Serial.begin(9600);
Serial.println(F("Initialize System"));
acd.begin(NORMAL_MODE, ON);

}

void loop() {
// put your main code here, to run repeatedly:
//temp();
dimming();

}
void temp() {
temperature = module.readCelsius();

}

void dimming(){
if (temperature <= 30) {
power = 20;
acd.setPower(power); // setPower(0-100%);
Serial.print("lampValue -> ");
Serial.print(acd.getPower());
Serial.println("%");

}
if (temperature > 30) {
power = 0;
acd.setPower(power); // setPower(0-100%);
Serial.print("lampValue -> ");
Serial.print(acd.getPower());
Serial.println("%");

}
Serial.print("Temperature: ");
Serial.println(temperature);
delay(500);
}

Not properly work on STM32f103C8 board

hello !!!
I am using your library for controlling FAN but it does not work well. Onset power 50% at that time my fan working full mode. link zcd on PC13 pin So, It might create problem ??? <<-- I'm not sure.
I check the hardware it works perfectly even other hardware I had been using early. I am living in India so, operating frequency should be 50Hz. What kind of changes do I need to do in code?
I hope you will reply me as soon as possible. Thank you.

problem with dimmer and DHT11 sensor

Hi everyone,
I have recently started programming my arduino again and stumbled upon a problem that i don't really understand.
I am writing a program that uses a dht11 to detect air humidity and above a certain value i want it to turn on an ac fan by using an AC dimmer.
however, my dht11 returns nan except when i put the dimmer.begin statement from the setup in comments. Then it just gives the correct value.

i am using an arduino uno but also tried it on my nano with the same result.
the libraries i'm using are the ADAFruit DHT sensor library and the RoboDyn RBDDimmer
i've added the outputs of my serial monitor as images below. the one is with the dimmer.begin in comments that shows that my dht is working fine and the other is without the comments where it returns nan

#include "DHT.h" #include <RBDdimmer.h> #define dhtPin 12 //dht datapin on d12 #define dhtType DHT11 DHT dht(dhtPin, dhtType); float humidityVal; //air humidity int relaisPin = 11; //#define zeroCross 2 dimmerLamp dimmer(relaisPin); void setup() { Serial.begin(9600); pinMode(relaisPin, OUTPUT); pinMode(dhtPin, INPUT); dht.begin(); //dimmer.begin(NORMAL_MODE,OFF); Serial.println("dimmer started"); } void loop() { readDHT(); Serial.println(); //add empty line Serial.println(humidityVal); delay(1000); setDimmer(); delay(500); } void readDHT(){ humidityVal = dht.readHumidity(); //read humidity value if (isnan(humidityVal)){ Serial.println("FAILED to read DHT SENSOR!"); } else { Serial.print("humidity: "); Serial.println(humidityVal); } } void setDimmer(){ if (humidityVal>60){ dimmer.setPower(85); Serial.println("dimmer set to 85"); } else { dimmer.setPower(0); Serial.println("dimmer set to 0"); } }
prob1
prob2

0% light flicker

Hello,

I use this library to turn on a lamp and when I set the percentage to 0%, it happens that the light turns on and then turns off directly after.

An idea where this problem can come from

Examples do not work with ESP8266

Attempting to upload and run the SimpleToggleDimmer example on an ESP8266 throws an ISR not in IRAM! error.

I'm using Arduino IDE 1.8.9 with an Adafruit Feather HUZZAH 8266.

Cleared all the memory on the board and reflashed.

I see ICACHE_RAM_ATTR is used in source.
Any suggestions for troubleshooting from here?

ISR not in IRAM!

Abort called

>>>stack>>>

ctx: cont
sp: 3ffffd90 end: 3fffffc0 offset: 01b0
3fffff40:  40202aed 00000001 3ffef264 40202b0f  
3fffff50:  0001c200 0000001c 00000000 3ffee578  
3fffff60:  3fffdad0 3ffee520 00000005 401006c6  
3fffff70:  3fffdad0 00000001 3ffee520 4020123d  
3fffff80:  0001c200 0000001c 3ffee2b8 40201276  
3fffff90:  feefeffe 3ffee520 3ffee2b8 4020104a  
3fffffa0:  feefeffe 00000000 3ffee548 402019e0  
3fffffb0:  feefeffe feefeffe 3ffe8500 401009b1  
<<<stack<<<

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v8b899c12
~ld

Strange behaviour with my LED lamp

These are test results with ESP8266 160 Mhz (and also same using 80 Mhz)

With LED bulb (IKEA RYET LED 400lm, 5W, LED1628G5, 220V)
0-28% nothing
29% bulb is on/of with frequency about 2-4 Hz
30% about 80% light
35-99% = maximum light.

With classic bulb - wolfram - (which you canot buy anymore in my country)
0-40% = nothing
40-100% = linear dimming

So great for old bulbs, terrible for LED.
Is that as expected by design?

Error : ISR NOT IN IRAM! on Nodemcu (ESP8266 - 12F)

Hi, looks like the libraries are not functioning on Nodemcu/ESP8266. After uploading the sketch in Arduino IDE, the board crashes and give the error "ISR NOT IN IRAM!".

I tried downgrading to on older version of the ESP8266 framework in the IDE, without luck.

Any ideas?

Spasibo!

arduino nano compile error

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 <LiquidCrystal.h> // LCD Library
#include <OneWire.h> // Temp Sensor Library
#include <DallasTemperature.h> // Temp Sensor Library
#include <RBDdimmer.h> // 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.

Missing STM32F4 source

Missing source for STM32F4 family

include/RBDdimmer.h:24:10: fatal error: stm32duino/STM32F4/RBDmcuSTM32F4.h: No such file or directory

Source in header indicates support.

#if   defined(ARDUINO_ARCH_AVR)
	#include "avr/RBDmcuAVR.h"
#elif defined(ARDUINO_ARCH_ESP32)
	#include "esp32/RBDmcuESP32.h"
#elif defined(ARDUINO_ARCH_ESP8266)
	#include "esp8266/RBDmcuESP8266.h"
#elif defined(ARDUINO_ARCH_SAMD)
	#include "samd/RBDmcuSAMD21.h"
#elif defined(ARDUINO_ARCH_SAM)
	#include "sam/RBDmcuSAM.h"
#elif defined(ARDUINO_ARCH_STM32F1)
	#include "stm32duino/STM32F1/RBDmcuSTM32F1.h"
#elif defined(ARDUINO_ARCH_STM32F4)
	#include "stm32duino/STM32F4/RBDmcuSTM32F4.h"
#else 
	#error "This library only supports boards with an AVR, ESP32, ESP8266, SAMD, SAM, STM32F1/F4 processor."
#endif

Documentation

Its small mistake in documentation in front page of this repository.
6. Function getMode displays values of current work mode
Example: Serial.print(dimmer.getPower()); Result 0 (NORMAL_MODE) or 1 (TOGGLE_MODE)

in the example it should be getMode instead of getPower()...
may be this is helpful to you.
Thank You..

Global variables memory issue with Uno

Trying to load the "simple potentiometer" code on an Uno to use with the dimmer but getting "Global variables using too much dynamic memory". Have tried reloading the library as suggested on another thread, but still the same. Also same problem with "simple button" code. I think this is an issue others have had so any fix very welcome.

F4 support is real ?

**.pio/libdeps/blackpill_f401cc/**RBDdimmer/src/RBDdimmer.h:21:3: error: #error "This library only supports boards with an AVR, ESP32, ESP8266, SAMD, SAM, STM32F1/F4 processor."
#error "This library only supports boards with an AVR, ESP32, ESP8266, SAMD, SAM, STM32F1/F4 processor."
And what to do ? It Is F4?

Zero Cross

I am trying to use your Module with this library for dimming 1400W AC fan but there are some frequency problems on lower voltages. It is probably about zero cross detection and to fix this problem I found zero-cross detection codes into your site but while Dimming level (0-128) 0 = ON, 128 = OFF in that sketch, in official library we are using % values for dimming. So how to adapt this codes to RBDDimmer library?
NOTE: You can find a discussion about this issue here.

Arduino Due

Hello,

I am working with your AC Light Dimmer Module and the RBDDimmer.h library. I am also using a Arduino Due to control the power send to a heating cartbridge from classic voltage (220V) as source.
But I can't succeed to make work your example SimpleToggleDimmer.ino. I followed your tutorial, connecting :

  • Module = VCC / 3.3V = Arduino
  • Module = GND / GND = Arduino
  • Module = Z-C (zerocross) / 5 (digital PWM 5) = Arduino
  • Module = PWM (output) / 12 (digital PWM 12) = Arduino.
    When I turn on the power, the cartbridge heat by itself and if in the Arduino code I add some functions to set the power of the module, there is no modification of the variation of the cartbridge (which I check with a temperature sensor), as if the setPower function was not functionning (or maybe I am using a wrong pin of the Arduino).

My Arduino code?

#include <RBDdimmer.h>//
#define outputPin  12 
#define zerocross  5

dimmerLamp dimmer(outputPin, zerocross);

void setup() {
  Serial.begin(9600);
  dimmer.begin(TOGGLE_MODE, OFF);
  Serial.println("--- Toggle dimmer example ---");
  dimmer.toggleSettings(0, 100); //Name.toggleSettings(MIN, MAX);
  dimmer.setState(ON); // state: dimmer1.setState(ON/OFF);
  dimmer.setPower(1);
}

void loop() {
  if (Serial.available() > 0)
  {
    int val = Serial.readStringUntil(10).toInt();
    dimmer.setPower(val);
  }
  delay(1000);
}

I thank you in advance if you can help me to understand why even your simple example does not work. Maybe I have to configure some pin as output with the pinMode function ?
Best regards.

Interrupt Conflict with <Servo.h>

Trying to do this:

#include <Servo.h> (from arduino distro)
#include <RBDdimmer.h>

In my sketch for arduino MEGA board.

Apparently both libs are competing for an interrupt vector 42...

Arduino: 1.8.13 (Mac OS X), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

libraries/RBDDimmer-master/avr/RBDmcuAVR.cpp.o (symbol from plugin): In function dimmerLamp::dimmerLamp(int)': (.text+0x0): multiple definition of __vector_42'
libraries/Servo/avr/Servo.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
Multiple libraries were found for "Servo.h"
Used: /Users/billparkinson/Documents/Arduino/libraries/Servo
Not used: /Applications/Arduino.app/Contents/Java/libraries/Servo
exit status 1
Error compiling for board Arduino Mega or Mega 2560.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Is there a way to #define something to avoid this?

Timing issue

Hi

Looking at the code for ESP8266, I found something strange about ISR timer:
void dimmerLamp::timer_init(void) { timer1_attachInterrupt(onTimerISR); timer1_enable(TIM_DIV16, TIM_EDGE, TIM_SINGLE); timer1_write(timeoutPin); //100 us }
The 100us as comment sounds to be the right value (indeed with 50Hz signal, we have 10ms demi-period and so with 100 steps (or %) allowed, we need a 10 000/100 = 100us timer)

yet above is written:
int timeoutPin = 435; // 80us

In fact 435 means (0.2*435) = 87us... but why? it should be 100us and so 500... I don't understand it and moreover there is a difference in the code itself: at one place it is written 100us, on another 80us...

Timer being shorter that it should (in my opinion!), it could explain some flickering or at least some not 0W consumption at dimmer = 0

@VSneg as you seem to be one of the writer of this library, I would appreciate your feedback

Won't compile for a ESP32

Hi all,
I downloaded the Library and imported it to my Arduino IDE. I then loaded the example "SimpleButton" and tried to compile it before I changed a single line of code. Sadly it did not compile and it showed the below errors. Can anybody tell me what I need to do to get the code to work. Many thanks in advance for any help offered.


In file included from c:\Arduino\libraries\RBDDimmer-master\src/esp32/RBDmcuESP32.h:10,
from c:\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:9,
from C:\Users\alan\AppData\Local\Temp.arduinoIDE-unsaved202242-18244-1m13py7.vo2c\SimpleButton\SimpleButton.ino:53:
C:\Users\alan\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.2/tools/sdk/esp32/include/esp_hw_support/include/esp_intr.h:8:2: warning: #warning esp_intr.h is deprecated, please include esp_intr_alloc.h instead [-Wcpp]
#warning esp_intr.h is deprecated, please include esp_intr_alloc.h instead
^~~~~~~
In file included from C:\Users\alan\AppData\Local\Temp.arduinoIDE-unsaved202242-18244-1m13py7.vo2c\SimpleButton\SimpleButton.ino:53:
c:\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:36: warning: "ALL_DIMMERS" redefined
#define ALL_DIMMERS 30

In file included from c:\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:9,
from C:\Users\alan\AppData\Local\Temp.arduinoIDE-unsaved202242-18244-1m13py7.vo2c\SimpleButton\SimpleButton.ino:53:
c:\Arduino\libraries\RBDDimmer-master\src/esp32/RBDmcuESP32.h:17: note: this is the location of the previous definition
#define ALL_DIMMERS 50

C:\Users\alan\AppData\Local\Temp.arduinoIDE-unsaved202242-18244-1m13py7.vo2c\SimpleButton\SimpleButton.ino:61:28: error: no matching function for call to 'dimmerLamp::dimmerLamp(int)'
dimmerLamp dimmer(outputPin); //initialase port for dimmer for MEGA, Leonardo, UNO, Arduino M0, Arduino Zero
^
In file included from C:\Users\alan\AppData\Local\Temp.arduinoIDE-unsaved202242-18244-1m13py7.vo2c\SimpleButton\SimpleButton.ino:53:
c:\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:59:9: note: candidate: 'dimmerLamp::dimmerLamp(int, int)'
dimmerLamp(int user_dimmer_pin, int zc_dimmer_pin);
^~~~~~~~~~
c:\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:59:9: note: candidate expects 2 arguments, 1 provided
c:\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:38:7: note: candidate: 'constexpr dimmerLamp::dimmerLamp(const dimmerLamp&)'
class dimmerLamp
^~~~~~~~~~
c:\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:38:7: note: no known conversion for argument 1 from 'int' to 'const dimmerLamp&'
c:\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:38:7: note: candidate: 'constexpr dimmerLamp::dimmerLamp(dimmerLamp&&)'
c:\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:38:7: note: no known conversion for argument 1 from 'int' to 'dimmerLamp&&'

Compilation error: exit status 1

Please Fix the ESP portion of this Lib .

I have added Change to the ISR ability and corrected what others have already suggested .

It is frustrating to purchase RobotDyn products only to have the firmware not function .

Here is the fixed Lib completed that will remove ESP flashing frustration and also enable reasonable AC LED control .

https://drive.google.com/file/d/13wZMFQneHm8znYDxutUyMGcZuyUESraV/view?usp=sharing

RBDmcuESP8266.cpp

line: 9 int rise_fall_change = true; // added change
line: 61 attachInterrupt(inPin, isr_ext,CHANGE); // set to CHANGE and works with incans or leds.

Note; From my testing and experience with the Robotdyn AC module , by adding a parallel load to Led fixtures the top end percentage is not clipped at 80% but works correctly through to 100%

Thank you

Here is code for a Web Server to test on your Esp + AC device

``#include <ESP8266WiFi.h>
#include <ESPAsyncTCP.h>
#include <ESPAsyncWebServer.h>
#include <RBDdimmer.h>//
// Replace with your network credentials
const char* ssid = "hAPP dAYS"; //REPLACE_WITH_YOUR_SSID
const char* password = "WORDPASS"; //REPLACE_WITH_YOUR_PASSWORD

//const int output = 2;
#define outputPin D6 // Set to your Gpio liking
#define zerocross D1 // for boards with CHANGEBLE input pins

dimmerLamp dimmer(outputPin, zerocross); //initialase port for dimmer for ESP8266, ESP32, Arduino due boards

String sliderValue = "0";

const char* PARAM_INPUT = "value";

// Create AsyncWebServer object on port 80
AsyncWebServer server(80);

const char index_html[] PROGMEM = R"rawliteral(

<title>ESP Web Server</title> <style> html {font-family: Arial; display: inline-block; text-align: center;} h2 {font-size: 2.3rem;} p {font-size: 1.9rem;} body {max-width: 400px; margin:0px auto; padding-bottom: 25px;} .slider { -webkit-appearance: none; margin: 14px; width: 360px; height: 25px; background: #FFD65C; outline: none; -webkit-transition: .2s; transition: opacity .2s;} .slider::-webkit-slider-thumb {-webkit-appearance: none; appearance: none; width: 35px; height: 35px; background: #003249; cursor: pointer;} .slider::-moz-range-thumb { width: 35px; height: 35px; background: #003249; cursor: pointer; } </style>

ESP Web Server

%SLIDERVALUE%

<script> function updateSliderPWM(element) { var sliderValue = document.getElementById("pwmSlider").value; document.getElementById("textSliderValue").innerHTML = sliderValue; console.log(sliderValue); var xhr = new XMLHttpRequest(); xhr.open("GET", "/slider?value="+sliderValue, true); xhr.send(); } </script> )rawliteral";

// Replaces placeholder with button section in your web page
String processor(const String& var){
//Serial.println(var);
if (var == "SLIDERVALUE"){
return sliderValue;
}
return String();
}

void setup(){
// Serial port for debugging purposes
Serial.begin(115200);

//analogWrite(output, sliderValue.toInt());

// Connect to Wi-Fi
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to WiFi..");
}
dimmer.begin(NORMAL_MODE, ON); //dimmer initialisation: name.begin(MODE, STATE)

// Print ESP Local IP Address
Serial.println(WiFi.localIP());

// Route for root / web page
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
request->send_P(200, "text/html", index_html, processor);
});

// Send a GET request to <ESP_IP>/slider?value=
server.on("/slider", HTTP_GET, [] (AsyncWebServerRequest *request) {
String inputMessage;
// GET input1 value on <ESP_IP>/slider?value=
if (request->hasParam(PARAM_INPUT)) {
inputMessage = request->getParam(PARAM_INPUT)->value();
sliderValue = inputMessage;
//analogWrite(output, sliderValue.toInt());
dimmer.setPower(sliderValue.toInt()); // setPower(0-100%);

}
else {
  inputMessage = "No message sent";
}
Serial.println(inputMessage);
request->send(200, "text/plain", "OK");

});

// Start server
server.begin();
}

void loop() {

}``

Set power 0%

Hello,

I am working with your hardware (AC Light Module Dimmer) and the RBDimmer library code, I control heating cartridge with your module. But, in normal mode, when I set the power to 0%, my cartridge is heating whereas it doesn't do that... Is it normal for you? For now, to make colder my cartridge, I have to set the power to 1% but it means I have always at less 1% of power sent to the cartbridge.

I thank you in advance for any help ;)

Failure to Compile: Arduino Nano Every

When I try to compile one of the examples to upload to a Nano Every I get the following error:
"This library only supports boards with an AVR, ESP32, ESP8266, SAMD, SAM, STM32F1/F4 processor."

After some brief internet research, I found that the Atmega4809 on a Nano Every is supposedly an AVR processor. However, when selecting the board in the Arduino IDE, the Nano Every appears under the heading of "megaAVR" and not "AVR." I assume this is where the issue begins.

Is there any way to get this RBDdimmer library to work for the Nano Every?

I appreciate the help! I currently don't know much about the differences in processor architecture and am still fairly new to programming, but I am eager and willing to learn. I'm actually working on this "room-automation" project for that exact purpose; so, I am glad for any advice/assistance.

Light Stable

I use Arduino nano to control temperature by my bulb. My hardware include:

  • Arduino nano
  • Oled LCD i2C
  • Temperature sensor ds18b20
  • 2 button to set the temperature set point
    When I use your example, the light of my bulb is stable (without Oled, temp sensor code). But when I combine code display oled, get temp from sensor, the light bulb is not stable anymore.
    Can you explain for me and suggest solution? Thank you very much!

Random Flickers when using Serial on UNO (328p)

Hi,

Weve been working with the dimmers for months now and still cannot get it perfect, we are 230V 50hz AC and are experiencing random flickers if we take our serial baud rate up for HW communication with another chip, Flicker is fine when Baud rate is LOW (4800) but this is too slow for our other processes.

Any help would be really appreciated.

Thank you

Tacho feedback

Do you plan to use tacho and PID for better speed control???
It would be great ...

getState Example request

Can someone show me an example of how to check the state of dimmer using getState. I can't find any example of it in this git.

Thanks
Don

Change pin for zero-cross in Arduino Mega ATMega2560

Hi, is it possible to change the pin for zero-cross. I am currently using the pin D2 and i looked up and saw that for Mega, there are several other pin interrupts. I am planning to use pin D20, is there a way to configure it and how?

Thanks

error on compling with arduino ide

hi, i'm try to compile the example simplepotentiometer with arduino IDE and selecting my board nodemcu v1 ESP8266

i change inside the code:

dimmerLamp dimmer(outputPin, zerocross); //initialase port for dimmer for ESP8266, ESP32, Arduino due boards
//dimmerLamp dimmer(outputPin); //initialase port for dimmer for MEGA, Leonardo, UNO, Arduino M0, Arduino Zero

i'm using esp8266 library version 2.3

and those are the errors that i receive:

`

ATTENZIONE: La categoria 'Input' della libreria MechInputs non è valida. La imposto a 'Uncategorized'
ATTENZIONE: La categoria 'Input' della libreria SerialSensors non è valida. La imposto a 'Uncategorized'
sketch\SimplePotentiometer.ino.cpp.o:(.text.setup+0xc): undefined reference to `dimmerLamp::begin(DIMMER_MODE_typedef, ON_OFF_typedef)'

sketch\SimplePotentiometer.ino.cpp.o: In function `HardwareSerial::begin(unsigned long)':

C:\Users\Marco\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0\cores\esp8266/HardwareSerial.h:75: undefined reference to `dimmerLamp::begin(DIMMER_MODE_typedef, ON_OFF_typedef)'

sketch\SimplePotentiometer.ino.cpp.o: In function `setup':

C:\Users\Marco\Desktop\RBDDimmer-master\RBDDimmer-master\examples\SimplePotentiometer/SimplePotentiometer.ino:69: undefined reference to `dimmerLamp::setPower(int)'

sketch\SimplePotentiometer.ino.cpp.o: In function `loop':

C:\Users\Marco\Desktop\RBDDimmer-master\RBDDimmer-master\examples\SimplePotentiometer/SimplePotentiometer.ino:73: undefined reference to `dimmerLamp::setPower(int)'

C:\Users\Marco\Desktop\RBDDimmer-master\RBDDimmer-master\examples\SimplePotentiometer/SimplePotentiometer.ino:74: undefined reference to `dimmerLamp::dimmerLamp(int, int)'

sketch\SimplePotentiometer.ino.cpp.o: In function `__static_initialization_and_destruction_0':

C:\Users\Marco\Desktop\RBDDimmer-master\RBDDimmer-master\examples\SimplePotentiometer/SimplePotentiometer.ino:75: undefined reference to `dimmerLamp::dimmerLamp(int, int)'

collect2.exe: error: ld returned 1 exit status

exit status 1
Errore durante la compilazione per la scheda NodeMCU 1.0 (ESP-12E Module).
`

how i can solve? thanks

My Codes Stake can Someone help me

Here is my decoding result

Decoding stack results
0x401007de: puts(char const*) at C:\Users\jamsa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.2\cores\esp8266\libc_replacements.cpp line 117
0x4020aeac: __assert_func(char const*, int, char const*, char const*) at C:\Users\jamsa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.2\cores\esp8266\core_esp8266_postmortem.cpp line 275
0x4020b3b9: __attachInterruptFunctionalArg(uint8_t, voidFuncPtrArg, void*, int, bool) at C:\Users\jamsa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.2\cores\esp8266\core_esp8266_wiring_digital.cpp line 201
0x40209c88: String::~String() at C:\Users\jamsa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.2\cores\esp8266\WString.cpp line 125
0x4020b468: __attachInterrupt(uint8_t, voidFuncPtr, int) at C:\Users\jamsa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.2\cores\esp8266\core_esp8266_wiring_digital.cpp line 236
0x402091d1: dimmerLamp::ext_int_init() at C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\RBDDimmer-master\src\esp8266\RBDmcuESP8266.cpp line 62
0x4020920a: dimmerLamp::begin(DIMMER_MODE_typedef, ON_OFF_typedef) at C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\RBDDimmer-master\src\esp8266\RBDmcuESP8266.cpp line 71
0x40202698: setup() at C:\Users\jamsa\OneDrive\Desktop\project sinric pro\sinricpro2relay - Copy\sinricpro2relay/sinricpro2relay.ino line 95
0x4020aa4c: loop_wrapper() at C:\Users\jamsa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.2\cores\esp8266\core_esp8266_main.cpp line 194

Inconsistent control

Also getting inconsistent control on AC load. Looks like when power is above 95, it's actually chopping a lot .

This section doesn't make much sense to me:

		/*****
		 * DEFAULT DIMMING MODE (NOT TOGGLE)
		 *****/
		if (dimCounter[k] >= dimPulseBegin[k] )
		{
			digitalWrite(dimOutPin[k], HIGH);	
		}

		if (dimCounter[k] >=  (dimPulseBegin[k] + pulseWidth) )
		{
			digitalWrite(dimOutPin[k], LOW);
			zeroCross[k] = 0;
			dimCounter[k] = 0;
		}

Looks like in some conditions it will enter both if statements.

Mild pulsing at low power levels with AC Bulb

Driving a 120W AC bulb with an arduino,
There is a noticeable pulsing of the ac bulb at lower power levels and continues all the way near 50.
I'm pretty sure its there at other power levels too, its jut not that noticeable.
Same behaviour was seen with the Mega which led me to guess its a trigger timing issue. (?)
Tried multiple bulbs and arduinos.

Blinking

Incandescent lamp blinks on your software on the NodeMCU v3 system :(

Doesn't work for ESP8266

I tried using this lib for NodeMCU. It works for few seconds after that it shows this error.
Dimmer Program is starting...
Set value
lampValue -> 10%
lampValue -> 50%
lampValue -> 40%

Exception (0):
epc1=0x40201d7c epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: sys
sp: 3ffffc30 end: 3fffffb0 offset: 01a0

stack>>>
3ffffdd0: 40106e04 3ffe9294 3ffee5f4 00000020
3ffffde0: ffffffff 00000020 00000022 00000030
3ffffdf0: 00000017 0000001d 00000050 00000022
3ffffe00: 3fffc200 40106dcc 3fffc258 4000050c
3ffffe10: 40004378 00000030 00000016 ffffffff
3ffffe20: 60000200 00000008 00000000 80000000
3ffffe30: 20000000 3fff0818 80000000 203fc080
3ffffe40: 80000000 3fffc6fc 3ffe8e0c 3fff081c
3ffffe50: 00000274 003fc080 60000600 00000030
3ffffe60: 3fffc200 40106c3c 00000020 40106c84
3ffffe70: 40106e68 20000000 3fffc230 4000050c
3ffffe80: 40000f83 00000030 0000001b ffffffff
3ffffe90: 402034a6 00000023 ffffffff ffffffff
3ffffea0: 3ffe8e0c 4021af38 00000000 bfffffff
3ffffeb0: ffffffff 3fffc6fc 3ffe8e0c 3ffe91f4
3ffffec0: 3ffe89a0 015c891a 60000600 00000030
3ffffed0: 00000012 4021af38 3ffe8e0c 00000000
3ffffee0: ffffffff 3ffee5f4 3ffe8e0c 3fffdab0
3ffffef0: 00000000 3fffdcb0 3ffe89b0 00000030
3fffff00: 00000000 400042db 00000064 60000600
3fffff10: 40004b31 3fff079c 000002f4 003fc000
3fffff20: 40101f6e 3ffe89a0 3ffe9140 40107188
3fffff30: 4021aa05 3ffe9140 3ffe89a0 015c891a
3fffff40: 3fff079c 00001000 4021ae9e 00000008
3fffff50: 00000000 00000000 4021af4b 3ffe91f4
3fffff60: 3ffe89a0 006cca0b 3ffe89a0 60000600
3fffff70: 402034ad 3ffe91f4 3ffe89a0 015c5ff0
3fffff80: 402034f2 3fffdab0 00000000 3fffdcb0
3fffff90: 3ffe89b8 3fffdad0 3ffee6cc 4020250b
3fffffa0: 40000f49 00031343 3fffdab0 40000f49
<<<stack<<<

Use with STM32 Oficial ST Core 1.9.0

Dear friends,

I want to use the lib with a BluePill but with the STM32 ST oficial core.

01

And I get this error, so to correct it I added those:

02

So the compiler go more further but I have now this error...

03

Is someone could compile the lib with the oficial ST Core?

Regards.

Inquire about the pinout (Dimming and Zero-Cross) of the DIY IoT AC-Dimmer KIT module, ESP8266 Wi-Fi D1

I have uploaded sample program from Dimmer Library (RBDdimmer.h): https://github.com/RobotDynOfficial/RBDDimmer (SimpleWaveDimmerESP8226 file) but no response at all on dimmer module,

  • I want to ask, is the pin initialization in the program correct??, I'm using a micro wemos d1 mini

  • my dimming test uses a load of incandescent lamps, solder, and I test on a multimeter indicating there is no voltage and the dimming indicator does not respond, when the upload process the dimming indicator lights up,
    I followed the input pin in the sample program

I guess there is an error in the input pin in the program, but I don't know the pinout of the device because it doesn't have a clear schematic or datasheet

best regard

Severe pulsing when using multiple dimmers.

I am using this library with a Arduino Uno (AVR ATMEGA328P). I have come across two main problems.

  1. The frequency of dimming drops (pulses are more noticeable) as more dimmers are used (single zero-cross with multiple output/"PWM" pins). Beyond 3 dimmers the timing is not consistent enough to use with dimmable LEDS. The pulses are clearly visible on incandescent bulbs.

  2. The timing is unreliable. Adding dimmers seems to alter the timing of the dimming and thus the brightness. So a power level of 50% with 2 dimmers is visibly different than a power level of 50% with 6 dimmers.

I need to be able to use 5 dimmers for my project and at this point the library seems unusable for this case.

Is this somehow related the the interrupt capabilities of the arduino? Can a faster timer interrupt be set?

ESP32 dimmer

Hello is it possible to run the dimming stuf on core 2 of an ESP32 so core 1 could be used for MQTT tasks and all other kind of stuff.

Know i use a esp8266 for the main sketch and a attiny85 for dimming, so it is a dedicated procesor i have no issue with flickering on LED light.
As far as i have tested, IKEA led light won't dimm.
Philips an som cheap ones from oure local store work great.

Compiling error

I´m getting a bunch of errors while compiling, like....

sketch\SerialMonitorDim.ino.cpp.o:(.text.setup+0x14): undefined reference to `dimmerLamp::begin(DIMMER_MODE_typedef, ON_OFF_typedef)'

and a lot more of undefined references

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.