MKR1000 blink with external led?

Hello everyone, I'm quite new to the Arduino world, this is my second board, the first one was the Yun. The issue that I'm having with the Mkr1000 is that I always test first with the blink sketch. I set it to the pin 6 which is the built in led and everything worked out as it is supposed to. However I tried to test an sketch which works with the Yun, just a push button that whenever it's pressed it turns on the led. But it just won't work with the Mkr1000. Even just a led without the button, if I assign it to the pin 7 or something like that it will not blink, just the built in. Is there something pretty basic that I'm missing about this board? Thanks a lot in advance. :o

Hi @Maki_bOo,

Can you please share the sketch you are using and a photo of your wiring?

sandeepmistry:
Hi @Maki_bOo,

Can you please share the sketch you are using and a photo of your wiring?

Hello , sandeepmistry, this is my wiring:

And the sketch that I'm using which I tested with a Yun Board is the following (I have tried different pin combinations already):

const int buttonPin = 7; // the number of the pushbutton pin
const int ledPin = 6; // the number of the LED pin

// variables will change:
int buttonState = 0; // variable for reading the pushbutton status

void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}

void loop() {
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);

// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
} else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
}

Hi @Maki_bOo,

Things seem ok here, I've attached a photo of what I tested and used the following sketch:

void setup() {
  pinMode(7, OUTPUT);
}

void loop() {
  digitalWrite(7, HIGH);
  delay(1000);
  digitalWrite(7, LOW);
  delay(1000);
}

Please note the MKR1000 operates on 3.3V instead of 5V like the Yun, I would strongly suggest using the VCC (3.3V) pin instead of 5V. Also, maybe you need a lower resistor because of the lower voltage.

Sorry, here is the photo.

Bad boy Sandeep you been using breadboard for a soldering iron rest LOL

I tested this configuration and code and it work. This is going to help me with my post.

Thanks.

Maki_bOo:
Hello , sandeepmistry, this is my wiring:

And the sketch that I'm using which I tested with a Yun Board is the following (I have tried different pin combinations already):

const int buttonPin = 7; // the number of the pushbutton pin
const int ledPin = 6; // the number of the LED pin

// variables will change:
int buttonState = 0; // variable for reading the pushbutton status

void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}

void loop() {
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);

// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
} else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
}

Looks like it was just a matter of welding. I just connected it, thought the pressure was enough to make contact between the metal of the pins. After adding welding to the pins everything runs fine now. Now the second step, to send some information through wifi into a php server with mysql!