|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Pointer to pwm
I just wanted to make sure this was safe to do.
Code:
typedef struct
{
// stuff
unsigned char* pwm;
} Motor;
void InitMotor( Motor* motor, unsigned char* pwm, /* more parameters */ )
{
// stuff
motor->pwm = pwm;
}
then if I want to change the motor speed
Motor myMotor; InitMotor( myMoter, pwm10 );
myMotor.pwm = 127; // set it to nuetral
Thanks |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Suspicious pointer conversion | ebowla | Programming | 2 | 01-26-2008 12:13 PM |
| laser pointer | 1574aviad | Technical Discussion | 9 | 02-20-2005 08:25 PM |
| pwm 13-15 | wayne 05 | Programming | 2 | 10-04-2003 12:08 PM |
| PWM | Antonio | Technical Discussion | 21 | 01-06-2003 02:44 PM |
| Pwm | VanWEric | Programming | 17 | 11-01-2002 04:07 PM |