Hi Micah! The reason is your |= for assigning values to TA0CCR1. This is the wrong operator here. Once a bit got set in the register, another |= will only set more bits (if not set already), but it can never clear any. Use = instead. Better always use = for register settings, so all |= can be replaced by = in your program. And you should use brackets when testing for multiple clauses: if( (ADC10MEM > 50) && (...) ) { ... } Why do you use those magic HEX values instead of real numbers? 0xFF is 255. It is easier to read. Dennis
↧