-38.2%

Netduino Go - Button Module

Netduino Go! - Button Module
SKU: P00000316

2 pcs. available from stock

Regular Price: CHF8.90

Special Price CHF5.50

.

Fast shipping from our own warehouse in Steinhausen/ZG. Free delivery for orders starting from CHF 300.00!

Products can also be picked up.

Questions or suggestions? Contact us.

Product Description
Details

The netduino GO! Button module is a single button. The button class has three features, the pressed and released events, and the ButtonState property.

Sample Code:

using System.Threading;
namespace NetduinoGo_Test
{
    public class Program
    {
        static NetduinoGo.RgbLed led = new NetduinoGo.RgbLed();
        static NetduinoGo.Button button = new NetduinoGo.Button();

        public static void Main()
        {
            led.SetColor(0, 0, 0);

            button.ButtonPressed += new NetduinoGo.Button.ButtonEventHandler(button_ButtonPressed);
            button.ButtonReleased += new NetduinoGo.Button.ButtonEventHandler(button_ButtonReleased);

            Thread.Sleep(Timeout.Infinite);
            
            // Or for the same behavior with no events, use the code below.

            //while (!button.ButtonState)
            //{
            //    // wait!
            //}

            //while (true)
            //{
            //    if (button.ButtonState)
            //        led.SetColor(0, 255, 0);
            //    else
            //        led.SetColor(255, 0, 0);
            //}
        }

        static void button_ButtonReleased(object sender, bool buttonState)
        {
            led.SetColor(0, 255, 0);
        }

        static void button_ButtonPressed(object sender, bool buttonState)
        {
            led.SetColor(255, 0, 0);
        }
    }
}
Additional Information
Additional Information
SKU P00000316
Weight 0.0100
Manufacturer Secret Labs LLC
Reviews
Write Your Own Review

Only registered users can write reviews. Please, log in or register

Questions or Suggestions?

Do you have a question about a product? Do you have a suggestion for the description or even found an error? Contact us!