c_cpp adafruit_feather_huzzah_esp8266_pullup_test.ino

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c_cpp adafruit_feather_huzzah_esp8266_pullup_test.ino相关的知识,希望对你有一定的参考价值。

// Which pins are able to be used with an internal
// pull up resistor on the Adafruit Feather Huzzah ESP8266?
// There has been some confusion around.
// https://forums.adafruit.com/viewtopic.php?f=19&t=86182
// http://www.esp8266.com/viewtopic.php?f=32&t=11614
// so this is a table of the test
// | GPIO pin | is able to pull up? |
// | :--      | :--                 |
// | #0       | No                  |
// | #2       | Yes                 |
// | #4       | Yes                 |
// | #5       | Yes                 |
// | #12      | Yes                 |
// | #13      | Yes                 |
// | #14      | Yes                 |
// | #15      | No                  |
// | #16      | No                  |

int buttonpin = 15;
int ledpin = 0;
void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  pinMode(buttonpin, INPUT_PULLUP);
  pinMode(ledpin, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  Serial.println(digitalRead(buttonpin));
  if (digitalRead(buttonpin) == LOW) {
    digitalWrite(ledpin, HIGH);
  } else {
    digitalWrite(ledpin, LOW);
  }
}

以上是关于c_cpp adafruit_feather_huzzah_esp8266_pullup_test.ino的主要内容,如果未能解决你的问题,请参考以下文章

c_cpp 127.单词阶梯

c_cpp MOFSET

c_cpp MOFSET

c_cpp 31.下一个排列

c_cpp string→char *

c_cpp 54.螺旋矩阵