Pin Explanation

I'm new to Arduino and similar, now i'm using the WeMos D1 mini and these are the pins

http://community.blynk.cc/uploads/default/original/2X/4/4f9e2245bf4f6698e10530b9060595c893bf49a2.png.
I have to connect a LED and a distance sensor; for what I have seen I need to connect the LED to the D4 pin (right?), and where should I connect the sensor? How do I decide it?
Thank you all

giacomoporetti:
I need to connect the LED to the D4 pin (right?)

No, you could connect an LED to any of the digital pins. The WeMos D1 Mini has the little built in blue LED connected to D4 so if you don't want to connect an external LED you could use that one.

giacomoporetti:
where should I connect the sensor?

Which sensor are you using?

giacomoporetti:
How do I decide it?

Some pins do have special properties so the device you are attaching to the pin can determine which pin it must be connected to but in general you could use any of the pins that start with D as a digital input or output.

I'm using a hc-sr04 sensor,
so if I want to connect an external LED i can't use pin D4 right?

both the sr04 and a LED are digital devices(they only have 2 states either ON or OFF)
so they both can be used on ANY digital pin including D4.

but if I connect the LED to D4, every time i turn off the external LED tbhe built in LED turns on, right?

No, the LEDS would turn on/off together

Then i can use every pin from D0 to D8 without any differences?

Yes

some of them have 10k,scl,sda exc... is this important or only IO is important in my situation?

Those are alternate uses for those particular pins.

no need to worry about that in your case.

thank you very much

glad I could help.

Hutkikz:
No, the LEDS would turn on/off together

That depends entirely on how they're wired. Most LEDs are hooked up to be active HIGH, but active LOW is also an option and nothing prevents one of each from being on the same pin.

giacomoporetti:
some of them have 10k,scl,sda exc... is this important or only IO is important in my situation?

Sometimes schematics and diagrams will be labelled with the function of a pin instead of its Arduino label. I would heavily encourage you to do the same as well. For example, instead of saying LED1, LED2, LED3, Button1, and Button2, label them something like Error, Activity, PowerOn, Start/Pause, and Menu, or whatever intention that you are using the pin for.

Obviously you will still need to know what pins they are going to, but having the additional function label makes it easy for humans to interpret what's going on, especially if you use the customary names for standard funcitons. A pair of wires called SCL and SDA makes it dead obvious that there's an I2C bus on the board, for example.