Quote:
|
Originally Posted by Xufer
pseudo example
Code:
if (rc_dig_in01 == 1)
{ joy_1 <= 127;}
else
{joy_1 == joy_1;}
|
It's important to remember that in C "==" is a logical equal to operator and "=" is an assignment operator. "<=" is also a logical operator meaning less than or equal to. So I think you would want your code to look like this:
Code:
if (rc_dig_01 == 1) {
if (joy_1 <= 127) {
joy_1 = joy_1;
} else {
joy_1 = 127;
}
} else {
joy_1 = joy_1;
}