6 Replies Latest reply on Jan 14, 2015 2:44 PM by Tim_LHUILLIER

    no detect my button with Grove Starter Kit

    Tim_LHUILLIER

      Hi,

       

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

       

      IMG_20150112_142755.jpg

       

      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 = 3;                        // 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