We're having a hard time with pwm outputs in the default code.
We assign an 8-bit value to, say, pwm02, and then printf pwm02. The output looked like gibberish, but when we printf-ed it in binary format, the 8-bit value was in the high byte of the value.
We've tried various methods of casting, shifting, and other wierd things, all to no avail. (see some examples below) Can anyone help?
Code:
pwm02 = (unsigned char)Get_Analog_Value(rc_ana_in01)>>2;
printf("%d\n", pwm02);
// output: 10496
Thanks in advance,
Jon B (: