Grove Electromagnet does not work

Hi.



I have an Arduino Uno and the Seeedstudio Baseshield and connected the magnet and uploaded the code as described in the speed-wiki. But the magnet does not work, nor is the LED.

Has anyone had the same issues or has any advice?

Maybe I made a mistake with the code?



hop you can help me.

Change the 0 in the code to a 2 and it works!

Hi there,



Sorry and thanks for the inputs, we correct the error in wiki page as below, thanks.



http://wiki.seeedstudio.com/Grove-Electromagnet/

[code]/*
Turns on an Electromagnet on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/

int Electromagnet = 2;
int LED = 13;

// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(Electromagnet, OUTPUT);
pinMode(LED, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
digitalWrite(Electromagnet, HIGH); // turn the Electromagnet on (HIGH is the voltage level)
digitalWrite(LED, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(Electromagnet, LOW); // turn the Electromagnet off by making the voltage LOW
digitalWrite(LED, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}[/code]