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.
228 stars 104 forks source link

Arduino Due #9

Closed Goczilla closed 5 years ago

Goczilla commented 5 years ago

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 :

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.