Go Down

Topic: Don't know this syntax - what does L mean? (Read 569 times) previous topic - next topic

endrew

Feb 28, 2010, 11:30 pm Last Edit: Feb 28, 2010, 11:31 pm by endrew Reason: 1
in this line:

OCR1A=(((angle*(SERVO_AILE_MAX-SERVO_AILE_MIN))/180L)+SERVO_AILE_MIN)*2L;

180L?
2L?

Thanks!

Coding Badly

#1
Feb 28, 2010, 11:36 pm Last Edit: Feb 28, 2010, 11:36 pm by bcook Reason: 1
The L declares the constant is a long-integer.  This forces the compiler to perform the arthimetic using long-integers (32 bit) rather than int-integers (16 bit).  Usually this is done to avoid an overflow.


Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy