am i right in thinking that, the number outside the brackets is the physical pin number
and the interrupt number (the one in brackets) is the number i use in the attachInterrupt method
for example to set 2 interrupts
attachInterrupt(0, myFunc, FALLING) // sensor attached to pin 2
attachInterrupt(1, myOtherFunc, FALLING) // sensor attached to pin 3
am i right in thinking that, the number outside the brackets is the physical pin number
and the interrupt number (the one in brackets) is the number i use in the attachInterrupt method
am i right in thinking, i can take a feed from the 5+v pin on the arduino, put my resistor in line, then split the line one going to pin 5 (or my chosen pin) and the other to the weather vane.
and GND just goes direct to the Arduino GND pin?
if so, can someone explain how/why this works? so that I understand please?
Yes right again. However you don't need to wait for delivery of your resistor. Just wire it up without and enable the internal pull up resistor, by doing a digithaWrite high to your input pin.
DrogoNevets:
do you mean didtalWrite? even though its an analog input?
Analog inputs cannot function as interrupts. What exactly are you trying to accomplish here?
Are you looking for an interrupt to occur when a particular analog signal crosses a certain threshold? If so, you need to set up an external comparator as the source to a digital input that serves as your interrupt.
That, or code a 'software' interrupt that continually reads an Analog input and initiates some function when said threshold is crossed.
Analogue inputs will work like digital ones just use the numbers pin 14 for input 0, pin 15 for input 1 and so on.
So yes for analogue input 5 use pin 19.