Can arduino inputs take voltage up to 12V froma pushbutton?

hello guys,

i am using a batteries of 12V and i want to give power to 8 pushbuttons which are connected to the arduino uno

so what i need to know is that, would that be harmfull for the arduino, a 12V voltage ?! or i must use a voltage regulator to get it down to 5V and then connect the pushbuttons to it ?

note that the arduino is taking power from the 12V batteries 2

aha nice ! so Vin of arduino

aha nice ! so Vin of arduino connected to 12V, the arduino will take care of turning the voltage to 5V, then all i have to do is

PinMode(pin, INPUT), digitalWrite(pin, OUTPUT); and when i click the current will go to gnd

but can i use the 5V voltage regulator method 2 ?

Nonsense.Syntax:

Nonsense.

Syntax: digitalWrite(pin, value). Value: HIGH or LOW. HIGH value with digitalWrite() will enable the internal pullup resistor. Writing LOW will disable the pullup resistor. If you don’t know what a pullup or pulldown resistor is, google it. And finally start to read: http://arduino.cc/en/Reference/HomePage

 

 

 

lol sorry about the OUPUT in

lol sorry about the OUPUT in digitalWrite() it was a fast writing mistake i didn’t mean it, yea i know what pullup is but never worked with it, only a learning example