Remove the transistor all together. Replace the motor with an LED, and put a 2K2 resistor in place of the IREF resistor and see that your software works.
The schematic's attached.
The code works but LED is not very bright with 1.6V voltage across.

Remove the transistor all together. Replace the motor with an LED, and put a 2K2 resistor in place of the IREF resistor and see that your software works.
The schematic's attached.
The code works but LED is not very bright with 1.6V voltage across.
