Created
September 10, 2023 03:45
-
-
Save GOROman/d3e315266556a8772bf84eca9199a12d to your computer and use it in GitHub Desktop.
stack-chan Super Slim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <M5Unified.h> | |
#include <Avatar.h> | |
using namespace m5avatar; | |
Avatar avatar; | |
#define SERVO_PIN_A 21 | |
#define SERVO_PIN_B 22 | |
void setup() | |
{ | |
M5.begin(); | |
avatar.init(); // 描画を開始 | |
pinMode(SERVO_PIN_A, OUTPUT); | |
pinMode(SERVO_PIN_B, OUTPUT); | |
} | |
void loop() | |
{ | |
digitalWrite(SERVO_PIN_B, HIGH); | |
delayMicroseconds(1450); | |
digitalWrite(SERVO_PIN_B, LOW); | |
delay(500); | |
digitalWrite(SERVO_PIN_B, HIGH); | |
delayMicroseconds(1000); | |
digitalWrite(SERVO_PIN_B, LOW); | |
delay(500); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment