Hi,
1st post.
I have been working through some Arduio code and I have what I hope is a basic question.
In the code below that works perfectly 'duration' is multiplied by 1000L.
Why the L at the end?
What does it mean.
void playTone(int tone, int duration) {
for (long i = 0; i < duration *1000L; i += tone *2) {
digitalWrite(speakerPin, HIGH);
delayMicroseconds(tone);
digitalWrite(speakerPin, LOW);
delayMicroseconds(tone);
}
}
I'm tryingt o understand when I just multiply my 1000 and when I multiply by 1000L.
I tried removing the L from the code but it failed, so obviously it is important.
Any info much appreciated.
Albert.