|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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 (: |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Tether for new EduBot Controller | gburlison | Programming | 9 | 18-12-2003 17:53 |
| pwm 13-15 | wayne 05 | Programming | 2 | 04-10-2003 12:08 |
| PWM and burning out motors | patrickrd | Technical Discussion | 7 | 19-06-2003 15:30 |
| Hints For Rookie Programmers | Noah | Programming | 30 | 20-02-2003 20:07 |
| relay and pwm outputs | nick_champ_2 | Electrical | 1 | 31-01-2003 13:08 |