1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

STM32C011「printf()」で遊ぶ。(PA8ハードウェアシリアル)(STM32C011J4M7)

Last updated at Posted at 2024-03-05

目的
printfがサポートされているので使ってみる

結果

o_cop978.jpg

プログラム




//SER_PA8_printf_C011_1


//初期化
void setup() {

  Serial.setTx(PA8);
  Serial.setHalfDuplex();
  Serial.begin(9600);

  //ピンの初期化 PB8
  pinMode(PB7, OUTPUT);

} //setup


//メインループ
void loop() {

  //「46」を出力
  Serial.printf("%d\r\n",46);
  
  digitalWrite(PB7, HIGH);//PB7をオン
  delay(1000); //1秒待つ

  digitalWrite(PB7, LOW);//PB7をオフ
  delay(1000); //1秒待つ

} //loop


1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?