Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unsigned char AC_LOAD = 4;
- unsigned char dimming = 3;
- unsigned char i = 55;
- void setup() {
- // put your setup code here, to run once:
- pinMode(AC_LOAD, OUTPUT);
- pinMode(3, INPUT_PULLUP);
- attachInterrupt(digitalPinToInterrupt(3), zero_cross_int, RISING);
- }
- void zero_cross_int() {
- int dimtime = (100 * i);
- delayMicroseconds(dimtime);
- digitalWrite(AC_LOAD, HIGH);
- delayMicroseconds(10);
- digitalWrite(AC_LOAD, LOW);
- EIFR = 1; EIFR = 2;
- }
- void loop() {
- // put your main code here, to run repeatedly:
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement