Skip to content

Instantly share code, notes, and snippets.

@ryo-takahashi
Created December 29, 2022 09:00
Show Gist options
  • Save ryo-takahashi/ba4e5f8c75d37a5834948d15332b3e3f to your computer and use it in GitHub Desktop.
Save ryo-takahashi/ba4e5f8c75d37a5834948d15332b3e3f to your computer and use it in GitHub Desktop.
#include <SwitchControlLibrary.h>
const int TX_LED_PIN = 30;
void setup() {
pinMode( TX_LED_PIN, OUTPUT );
SwitchControlLibrary();
}
void loop() {
SwitchControlLibrary().pressButton(Button::A); // Aボタンを押す
SwitchControlLibrary().sendReport(); // Aボタンを押したことを反映
digitalWrite( TX_LED_PIN, HIGH );
delay(100);
SwitchControlLibrary().releaseButton(Button::A); // Aボタンを離す
SwitchControlLibrary().sendReport(); // Aボタンを離したことを反映
digitalWrite( TX_LED_PIN, LOW );
delay(200);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment