Skip to content

Instantly share code, notes, and snippets.

@carlos4242
Created June 27, 2018 11:41
Show Gist options
  • Save carlos4242/78f5ac5ab65958ec108328e82f2c9567 to your computer and use it in GitHub Desktop.
Save carlos4242/78f5ac5ab65958ec108328e82f2c9567 to your computer and use it in GitHub Desktop.
// the core of the program, a delayed triac fire a set time after zero cross
setupPin2InterruptCallback(edgeType: RISING_EDGE) {
setupTimerSingleShotInterruptCallback(microseconds: delayUs) {
digitalWrite(pin: triacPin, value: HIGH)
delay(microseconds: 200)
digitalWrite(pin: triacPin, value: LOW)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment