Hello Forum members, another newbie programmer with a few questions.
I'm using a UNO clone, 12V 300mA AC power module, NTE3100 Photon Coupled Interrupter Module, a 2 Relay Module for AC switching. I'm powering my breadboard (for the interrupter) with 3V coming off the UNO and 5V from the UNO to power the relay board. I read you can power up to 4 relays with the UNO, I'm only using 1 relay and 1 interrupter, should be OK power wise.
I'm wishing to momentarily trip an AC Relay (normally open, N/O, via Pin8 OUTPUT) that is driven by a "count" from a Photo Resistor from (Pin2 INPUT), then the count will need to be reset after each trip.
The AC Relay trip will be instantaneous OFF/ON/OFF in milliseconds for a very quick return to the previous state, awaiting another counted trip.
I'm rotating a windowed wheel to create the "count" via the photo resistor, once the count variable is met, an AC relay will momentarily trip (for a few milliseconds).
I think the BLINK sketch will start me off, and I believe I need an IF statement (IF "6" counts is met, THEN trip Pin8, for a few milliseconds, AND restart the count again until the next trip).
I have not had much luck finding Count / Trip / Reset information on the net.
So questions:
Which sketch shall I use?
How do I set the "trip" criteria?
How do I set the duration of the AC trip?
How do I reset the trip back to Zero?
Thanks for the inputs...