I am a beginner to Arduino programming and started working on my first Arduino project recently to power a Peltier cooling pad. Below is the code I used and in the circuit, I connected the positive (red wire) end of the Peltier to D12 of Nano Arduino board and the negative end( black wire) to the negative end of the 6V battery. Then I powered the Arduino board by connecting Vin(Arduino) and battery(+) using a jumper wire. The GND pin of the Arduino was connected to the battery(-) using a jumper wire.
The Peltier is not working and it would be a great help if someone can help me to understand what I did wrong.
int p=12;
void setup() {
pinMode(p,OUTPUT);
}
void loop() {
digitalWrite(p,HIGH);
delay(2000);
}