Using tilt switch with breadboard...

Hello, I am using the arduino starter kit, and I am on project 8, digital hourglass. I finished the project and completed the hourglass, but I am trying to complete the bonus challenge on the bottom of the page, which is to change the direction of the lights when you turn the project around using the tilt switch. I have some experience with programming and I managed to do this, but to change the output of the tilt switch, the arduino either has to be face up or face down because the tilt switch's UP side is facing in the same direction of the arduino.

I would like to make it so that the UP side of the tilt switch is pointing in the direction of the lights so that the switch changes states when one LED is on top or the other. However, the tilt switch has very small legs so I can't figure out a way to turn it around so that the UP side is facing the top led. Could someone help me with this? Thank you!

IMG_0110.JPG

IMG_0111.JPG

the arduino either has to be face up or face down because the tilt switch's UP side is facing in the same direction of the arduino.

Sorry but I don't understand that bit.

However, the tilt switch has very small legs so I can't figure out a way to turn it around so that the UP side is facing the top led.

Why not just invert the signal you get from it in software?

If you're wanting to turn the tilt switch 90° then plug it into the unused power and ground rails at the top of your first image, then add a couple of jumper wires to the new position.

Hi,
The OPs problem is the tilt switch is oriented so up is out of the board, to flip the display he has to invert the whole board has to got through 180Deg to operate the switch.

You can re-orientate the switch so up/down is along the length of the protoboard instead of vertical out of it, then you have the board sitting on its edge, turn it on its other ege to flip 180Deg.

Not a code problem, just a switch position realignment.

Tom..... :slight_smile: