//+============================================================================= // Leave pin off for time (given in microseconds) // Sends an IR space for the specified number of microseconds. // A space is no output, so the PWM output is disabled. // void IRsend::space (unsigned int time) { uint32_t highus = _1bitus/2 * 77; uint32_t lowus = _1bitus/2 * 77; int cnt = time / _1bitus; for( int i = 0; i < cnt; i++){ digitalWrite(TIMER_PWM_PIN, LOW); custom_delay_usec(highus); digitalWrite(TIMER_PWM_PIN, LOW); custom_delay_usec(lowus); } }
//+============================================================================= // Leave pin off for time (given in microseconds) // Sends an IR space for the specified number of microseconds. // A space is no output, so the PWM output is disabled. // void space (unsigned int time) { #if DEBUG == 1 Serial.print(-(int)time); Serial.print(","); #endif TIMER_DISABLE_PWM; // Disable pin 3 PWM output if (time > 0) custom_delay_usec(time); }
//+============================================================================= // Sends an IR mark for the specified number of microseconds. // The mark output is modulated at the PWM frequency. // void mark (unsigned int time) { #if DEBUG == 1 Serial.print(time); Serial.print(","); #endif if (time > 0) { TIMER_ENABLE_PWM; // Enable pin 3 PWM output custom_delay_usec(time); } }
//+============================================================================= // Sends an IR mark for the specified number of microseconds. // The mark output is modulated at the PWM frequency. // void IRsend::mark (unsigned int time) { TIMER_ENABLE_PWM; // Enable pin 3 PWM output if (time > 0) custom_delay_usec(time); }