Quantcast
Channel: Intel Communities: Message List
Viewing all articles
Browse latest Browse all 18089

no detect my button with Grove Starter Kit

$
0
0

Hi,

 

I have a intel edison arduino board with grove starter kit plus.

 

I connect my button in D2 and i want to interact with the led in board (pin 13)

My grove is powered in 5v and the green led (for powered) is on.

 

My arduino code is :

// demo of Grove - Starter V2.0
// Loovee  2013-3-10
// this demo will show you how to use Grove - Button to control a LED
// when the button was pressed, the led will on
// otherwise led off
// Grove - Button connect to D3
// Grove - LED connect to D7


const int pinButton = 2;                        // pin of button define here
const int pinLed    = 13;                        // pin of led define here


void setup()
{
    pinMode(pinButton, INPUT);                  // set button INPUT    pinMode(pinLed, OUTPUT);                    // set led OUTPUT
}


void loop()
{
    if(digitalRead(pinButton))                     // when button is pressed    {        digitalWrite(pinLed, HIGH);             // led on    }    else    {        digitalWrite(pinLed, LOW);    }      delay(10);
}

 

 

I ulpoaded this code but i push my button, the led (13) don't light.

 

And i don't understand why.

Thanks


Viewing all articles
Browse latest Browse all 18089

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>