button press enables/disables usb port

Hi I am following this tutorial http://blog.codebender.cc/2014/01/30/mux74hc4067/

I have uploaded the project to my mega2560 board. when I press the button on my breadboard instead of seeing a button press/ not pressed in the serial monitor.

The usb port itself either disables or enables, I have no idea why this is happening.

I am running version 1.8.5 of the IDE

thanks for all assistance.
jasemilly

What do you mean the USB port disables and enables?

What tells you that is happening?

(deleted)

Hi I took some photo’s I also checked it over again and can’t see my mistake.

thanks for all help

had to separate out i am sure the problem is around the button but can’t see whats wrong

Yup, the button connects +5 V directly to ground.

What do you think is going on between the button and the yellow wire?
Think harder.

You have it wired wrong, when pressed, it shorts out the power on the arduino board, causing it to shut down (by virtue of the ptc-fuse, probably), which causes it to disconnect from usb.

My man, what they are trying to say is:
Lets say you want to press a button ( normally open button) and it should arrive as " sense input high". Thus what you need to do is set a resistor to pulldown- and the button to 5V.

So one leg of resistor to GND, second ( free leg) to the pin - lets say D4 or your arduino.
The button- one leg to 5V and the second leg to D4. Thus you have a junction on D4 of resistor to gnd and the second leg of your button.
When you are not pressing the button- the D4 pin of arduino is "at 0v"
When you press the button the voltage " builds up at resistor for the time you press it"

Lets say you want to press a button and it should arrive as " sense input low". Thus what you need to do is set a resistor to pullup ( 5V) - and the button to GND.
So one leg of resistor to 5V, second ( free leg) to the pin - lets say D4 or your arduino.
The button- one leg to Gnd and the second leg to D4. Thus you have a junction on D4 of resistor tand the second leg of your button.