attiny tilt switch pwm

I have no idea how you wired it like the diagram he posted, since the markings on the pins are in some cases just a black blot because the image was scaled down too much.

The original diagram raises some serious questions about the wiring - the transistor is wired straight up wrong.

For NPN transistor:

Base goes THROUGH A RESISTOR to the arduino pin.
Collector goes to low side of load.
Emitter goes to ground.

Since you have been running it without a resistor in series with the base, you may have blown the transistor and/or the Arduino pin.

You will get better performance with a modern logic level N-channel MOSFET,- these get wired:
Gate goes to the Arduino pin, preferably through a 100+ ohm resistor.
Drain goes to low side of load
Source goes to ground

Your wiring of the tilt switch and button is also suspect in that diagram.

Have you seen what real schematics normally look like? With straight lines, and a marking to show when two wires that cross eachother are or are not joined? That makes the diagram more readable and more useful to yourself and the people trying to help you. It helps one to think more clearly about a project to have a diagram that's clean enough to see at a glance where each wire goes, rather than having to track each one down...