Emotions are controlled by chemicals sent from other parts of your body, not your brain, so if you don’t give it certain organs which make the chemical’s then it wont get depressed.
To teach it you wouldn’t shock it when it did something wrong, you would use positive reinforcement by feeding it the chemical dopamine, which would make it happy. This then has the effect of strengthening the signal so it will do something faster.
Brain cells just use a small amount of electricity(synapse)so if you have a sonar sensor or some sort of height sensor then you just send an electrical impulse threw the cell when you send the sound and when you receive(based on sonar) you can then control height. You can do this with any sensor as they all use electricity.
The advantage of it will not just be a rat flying a plane but also will work the opposite way eg make a brain able to control prosthetic limbs or able to control your pc by your mind or even reading peoples thoughts and super fast processors that work with low power consumption. the list continues
Any spelling mistakes are totally In tensional.