Pin 0V when i use a transistor

Please post your code.

Symptoms perfectly match a pin that's set to INPUT, pull-up enabled.