2015-02-04から1日間の記事一覧

Arduinoをはじめよう Example 03 C

本日もデバウンシング。 そしてデバウンシング最後です。 const int LED = 13; const int BTN = 7; int val = 0; int stat = 0; int old = 0; void setup() { pinMode(LED, OUTPUT); pinMode(BTN, INPUT); } void loop() { val = digitalRead(BTN); if (old …