int main(void) { configureAll(); EnableInterrupts(); // Global Interrupt Enable while (1) { switch (readMode()) { case 0: // Measure input voltage IEC0bits.T1IE = 1; // Enable timer T1 interrupts setPWM(0); // Turn off LED break; case 1: // Freeze IEC0bits.T1IE = 0; // Disable timer T1 interrupts setPWM(100); // Turn on LED with max brightness break; case 2: // LED brigthness control IEC0bits.T1IE = 0; // Disable timer T1 interrupts value2displays = pwmValues[readLEDValues()]; setPWM(value2displays); break; case 3: break; } } return 0; }
void ExtraAction::loadFromOverlay(Ogre::OverlayContainer *panel) { ASSERT(panel); ASSERT(!mCont); // ensure that we only initialize once // now configure the button configureAll(panel); disableAction(); }
int main(void) { configureAll(); EnableInterrupts(); TRISEbits.TRISE4 = 1; TRISEbits.TRISE5 = 1; while(1){ if(PORTEbits.RE4==1 && PORTEbits.RE5==0){ IEC0bits.T1IE = 0; // Autorizar a interrupção }else{ IEC0bits.T1IE = 1; // Autorizar a interrupção } } return 0; }
int main(void) { configureAll(); EnableInterrupts(); unsigned char c; printStr("Use '+' or '-' to change LED brightness: "); while (c = getChar()) { if (c == '+') { if (value2displays != 100) value2displays += 10; } else if (c == '-') { if (value2displays != 0) value2displays -= 10; } else continue; setPWM(value2displays); } return 0; }
int main(void) { configureAll(); EnableInterrupts(); while (1); return 0; }