So, to switch a PNP with the supply of 12V, I need to add a NPN with its collector to the base of the PNP, its base to microcontroller through a resistor, and its emitter to GND. Am I right?
So, to switch a PNP with the supply of 12V, I need to add a NPN with its collector to the base of the PNP, its base to microcontroller through a resistor, and its emitter to GND. Am I right?
No.
You forgot a resistor beween the collector of the NPN to the base of the PNP to limit the current. Without the resistor then both the NPN and PNP transistors would blow up!
You also forgot to add a resistor from base to emitter of the PNP to turn it off.