x まだ試していない 成功しました。2022/4/32 22:48
参考
もとの資料
STM32L010のプログラム
変更点は、PA_4とPA_5
#include "mbed.h"
Ticker flipper;
DigitalOut led1(PA_4);
DigitalOut led2(PA_5);
void flip() {
led2 = !led2;
}
int main() {
led2 = 1;
flipper.attach(&flip, 2.0); // the address of the function to be attached (flip) and the interval (2 seconds)
// spin in a main loop. flipper will interrupt it to call flip
while(1) {
led1 = !led1;
wait(0.2);
}
}
サンプル
本プログラムは、イメージです。
性能を保証するものでは、ありません。
個人的な感想です。 みるみる若返りました。(冗談) ただのサンプル(冗談)
いろいろ
余計な情報 現時点21:04 ふろ入ってくるわ
#include "mbed.h"
Ticker flipper;
DigitalOut led1(LED1);
DigitalOut led2(LED2);
void flip() {
led2 = !led2;
}
int main() {
led2 = 1;
flipper.attach(&flip, 2.0); // the address of the function to be attached (flip) and the interval (2 seconds)
// spin in a main loop. flipper will interrupt it to call flip
while(1) {
led1 = !led1;
wait(0.2);
}
}