i would like to know the c++ code to generate 1 increasing pwm on one pin of 89c2051 when signal comes at 3.4 of 89c2051 and decreasing pwm on the same pin of 89c2051 when signal comes at 3.5 [in of 89c2051.
"I'm also considering the -ChangeAllMagicNumbers switch to enable translation of nasty magic numbers to readable constants."
What we always have wanted.
enum { ONE = 1, TWELVE = 12 }; enum { UNSIGNED_ONE_SHIFTED_LEFT_12_STEPS = (unsigned)ONE << TWELVE }; enum { MAGIC_BIT_TO_TURN_ON_POWER_TO_ADC0 = UNSIGNED_ONE_SHIFTED_LEFT_12_STEPS }; A |= MAGIC_BIT_TO_TURN_ON_POWER_TO_ADC0;