My goal is to eventually control a halogen light with a proximity sensor via a dimmer and Arduino. I am posting here because the product's support has not been helpful, and there might be more information here.
My current challenge and question is more specific now that I have gotten further into the project. I have this AC Dimmer Module connected to my halogen, Arduino Uno, and power. I know that the halogen functions (I've plugged it directly into the wall). And it seems to work with this whole system to an extent because when I plug in the Arduino, the Arduino, the blue LED on the dimmer, and the connected halogen all flash upon setup. However, the simple code that I wrote is just trying to keep the halogen on (before venturing to coordinate it with a sensor). I am using the RBDDimmer.h library. I have print statements in the following code to track the state of the dimmer, which seems to be changing as intended, but I still don't see a change happening in the halogen or the LED indicator (which I thought should mirror the halogen's behavior). My code is below. Please help, and thanks!
#include <RBDdimmer.h>
//#define USE_SERIAL SerialUSB //Serial for boards whith USB serial port
#define USE_SERIAL Serial
#define outputPin 13
#define zerocross 2 // for boards with CHANGEBLE input pins
dimmerLamp dimmer(outputPin);
void setup() {
dimmer.begin(NORMAL_MODE, ON); //dimmer initialisation: name.begin(MODE, STATE)
dimmer.setPower(50);
dimmer.setState(ON);
Serial.begin(9600);
}
void loop() {
dimmer.setState(ON); //name.setState(ON/OFF);
delay(1000);
Serial.println(dimmer.getState());
dimmer.setState(OFF); //name.setState(ON/OFF);
delay(1000);
Serial.println(dimmer.getState());
}



