BirdNet-goMikrofon/Arduino-audio-tools-main/arduino-audio-tools-main/examples/examples-custom-boards/stm32f411-discovery/button/botton.ino
2026-09-26 01:20:55 +02:00

21 lines
535 B
C++
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// Button Example for STM32F411 Discovery Board
// This example reads the state of the user button and prints it to the serial monitor
// The user button is connected to pin PA0: pressed gives 1, released gives 0
// Compile with
// - USB Support: CDC generic Serial suppercedes USART
// - USART Support: Enabled (Generic Serial)
//
#define USER_BUTTON PA0
void setup() {
Serial.begin(9600);
pinMode(USER_BUTTON, INPUT);
}
void loop() {
bool active = digitalRead(USER_BUTTON);
Serial.println(active);
delay(1000);
}