DigitalReadSignal example in basics

Hello,

I am a total layman with very basic ideas in electronics,i was trying the DigitalReadSignal Example in and made a setup exactly with a resistor of 47* 10 to the power of 5.however in the serial output on the pc i am only getting a value of 0 even when i press the pushbutton.please help me out.what am i missing here.please keep in mind that you are helping a donkey out. :)

You mean Digital Read Serial I presume?

If you have one of those square switches you might need to swing it 90 degrees because of the way they're wired internally; you might have it the wrong way.

In any case, post a schematic of your setup: your actual setup, not just the one from the example. ANd might as well post your code while you're at it....

Hi,
Thnx for the suggestion but in this case my pushbutton has 2 pins on either side,so rotating 90 degree is not required in this case.by Code is ditto as that of the example,as i was trying it out.in the attachment is the scematic.

One thing i tried is to power up a green led with the 5v pin from the arduino uno using resistor,however my led is not glowing also.Is there a thing that the 5v pin will only supply power if connected with outer supply unit and not with USB?

Or have i somehow damaged the 5v pin.

i tried again to power a green led with 5v pin in a different section of breadboard.it worked.now wil try the same with that digital read serial example in this new side of breadboard.maybe the section is fauty in breadboard

Ahhhhhhh… hang on: that’s probably a board where the two halves are separate on the power. You need to jump the gap with some spare wire.

See pic…

breadboard2.jpg