Counts the number of times a pushbutton is pressed, and displays the count in the serial monitor.
Includes an automated test scenario that simulates the button presses and verifies the counter value.
Use Wokwi to simulate this project, and the Wokwi CLI to run the automated test.
This is a PlatformIO project. To build it, install PlatformIO, and then run the following command:
pio run
To simulate this project, install Wokwi for VS Code. Open the project directory in Visual Studio Code, press F1 and select "Wokwi: Start Simulator".
To run the automated test scenario, download the Wokwi CLI. Create a Wokwi CLI token and set it in the WOKWI_CLI_TOKEN
environment variable. Then run the following command:
Linux/Mac:
export WOKWI_CLI_TOKEN="your token goes here"
wokwi-cli --scenario button.test.yaml .
Windows:
$env:WOKWI_CLI_TOKEN="your token goes here"
wokwi-cli --scenario button.test.yaml .