-38.2%
Netduino Go - Button Module
Netduino Go! - Button Module
Artikelnummer:
P00000316
2 Stk. ab eigenem Lager sofort lieferbar!
Regulärer Preis: CHF 8.90
Special Price CHF 5.50
Artikelbeschreibung
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);
}
}
}
|
Zusatzinformation
Zusatzinformation
| Artikelnummer | P00000316 |
|---|---|
| Gewicht | 0.0100 |
| Hersteller | Secret Labs LLC |
Bewertungen
Fragen oder Anregungen?
Haben Sie eine Frage zum Produkt? Haben Sie eine Anregung zur Beschreibung oder sogar einen Fehler entdeckt? Kontaktieren Sie uns!
