diff --git a/docs/library/gpio.md b/docs/library/gpio.md index 74cb5f2..4193323 100644 --- a/docs/library/gpio.md +++ b/docs/library/gpio.md @@ -116,21 +116,22 @@ void detachInterrupt(uint32_t channel) ### GPIO 输入和输出模式 ```cpp -const auto LED = PB0; +const auto ledPin = PB0; const auto BUTTON = PF4; uint8_t stateLED = 0; void setup() { - pinMode(LED, OUTPUT); + pinMode(ledPin, OUTPUT); pinMode(BUTTON,INPUT_PULLUP); } void loop() { - if(!digitalRead(BUTTON)){ - stateLED = stateLED^1; - digitalWrite(LED,stateLED); - } + if(!digitalRead(BUTTON)) + { + stateLED = stateLED^1; + digitalWrite(ledPin,stateLED); + } } ```