I have a project that I’m working on. I have an Adafruit light sensor TSL2651, I also have an Iot relay I bought. I want to hook the sensor up with the relay so essentially when someone turns a light on, it trips the relay. When someone turns the light off, it shuts the relay off.
I have been able to get the two working independently, whenever I try to join both functionalities I can’t figure it out. I thought it would be as simple as, I need to create a new app, import the TSL2651 library, import the relay library and can do a couple if else statements that if the light levels drop below X turn the relay on (which i have plugged into pin D7)
Any help, or links to any project you have come across in the past please let me know!