PulseIn() / PWM Questions

Right when a question about Pulsein() popped into my mind I found a topic here where was told that PulseIn() does not work with int while my sketch does:

Topic:
PulseIn() not detecting pulse and timing out. (Read 54 times)

So let me combine my question with this one.

Why does my code work?

const byte ThrottlepinNumber=10;
pinMode(ThrottlepinNumber, INPUT);
int ThrottleInputValue=pulseIn(ThrottlepinNumber, HIGH, 30000);

The code is meant for reading the values from my RC receiver. Does it work because I use a PWM port? I think so but I think I need some explanation to fully understand.

The second question is (and I think it is related), what is the impact of that 30.000. The tutorial had it set at 25000 but in that case I could only read 1 channel. The rest was ignored or just to late (?). Once I set it to 30000 it worked for all 6 channels.

I am aware that this is not the optimal way to read my receiver but with this I can work out the rest of my code and fix this later.

So, has it to do with frequencies/ PWM etc?

It "works" because your RC pulses are less than 32768 microseconds long.

Use the correct data type and stop worrying.

TheMemberFormerlyKnownAsAWOL:
It "works" because your RC pulses are less than 32768 microseconds long.

Use the correct data type and stop worrying.

I did not mean to cross-post.

And stop worrying? I am not worried I just want to understand.

By the way, you can use INT upto a value.

"Parameters
pin: the number of the pin on which you want to read the pulse. (int)

value: type of pulse to read: either HIGH or LOW. (int)

Returns
the length of the pulse (in microseconds) or 0 if no pulse is completed before the timeout (unsigned long)"

Instead of short answering just say that mine works because INT goes up to 32768 and I the duration is longer, it just wouldnt. Working with INT if you are sure it stays below that value saves memory.

Then again, can you explain why the value 25.000 did not work and 30.000 does? Does it mean that my receiver takes more time to send the next value than 25000 microseconds?

Sareno:
Right when a question about Pulsein() popped into my mind I found a topic here where was told that PulseIn() does not work with int while my sketch does:

Topic:
PulseIn() not detecting pulse and timing out. (Read 54 times)

That post never determined why their pulseIn() call was often timing out. Since they didn't specify a timeout they got the default: 1 MILLION microseconds. Since they were getting no pulses in a million microseconds I suspect there was a wiring problem. Possibly the Arduino Ground was not connected to the Receiver Ground.
The "not an int" comment was just pointing out that the value that pulseIn() returns is 'unsigned long' and saving the result in an 'int' can cause problems with truncated values and negative pulse lengths.
The repeat cycle on an RC servo pulse is typically 20 milliseconds (50 Hz) but that is a very loose 'standard'. From the fact that you were getting timeouts at 25 milliseconds (25000 microseconds) but not at 30 milliseconds would lead me to believe that the repeat rate for your transmitter/receiver is particularly slow: closer to 30 than to 20.
The pulseIn() function doesn't use any PWM hardware so it does not matter at all if the pin is a PWM pin or not.

I will try another receiver later on, this one has been broken once. Maybe a bad fix.