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?

[実装編]Arduino Modulino Buzzer(STM32C011)-STM32G030F6

Last updated at Posted at 2025-10-24

いろいろ注意

  • (重要)Modulino Buzzerは、3.3V
  • プチ、ヒット(国内では、やや、初!!!(20251025
  • 過去ログを見て!!!
  • プルアップ抵抗、忘れずに
  • いろいろ、知らん間に、ESP32-C6が育つちゃって、秋月で1日に100個から200個、売れているぞ!!!(何に使って、いるんだ?(初期は、ソフト動かない、ソフト無いて、(「リフレイン」で)叫んでいたぞ!!!
  • いろいろ、見直して、見ると、XIAO ESP32-C6は、アンテナが付いて、LED,リポ(付く?)があるから、リモコン(ITO)に使われている
  • 主な追加、変更箇所

Wire.setSDA(10);  //PA10
Wire.setSCL(9);   //PA9

結果(BEEP)

Screenshot from 2025-10-24 10-10-49.png

Screenshot from 2025-10-24 10-18-51.png


/*
 * Modulino Buzzer - Basic
 *
 * This example code is in the public domain. 
 * Copyright (c) 2025 Arduino
 * SPDX-License-Identifier: MPL-2.0
 */

#include <Modulino.h>

// Create a ModulinoBuzzer object
ModulinoBuzzer buzzer;

int frequency = 440;
int duration = 1000;

void setup(){


  //STM32G030F6
  //I2Cのポートの変更
  Wire.setSDA(10);  //PA10
  Wire.setSCL(9);   //PA9


  // Initialize Modulino I2C communication
  Modulino.begin();
  // Detect and connect to buzzer module
  buzzer.begin();
}

void loop(){

  // Play tone at specified frequency and duration
  buzzer.tone(frequency, duration);
  delay(1000);
  // Stop the tone (0 frequency)
  buzzer.tone(0, duration);
  delay(1000);

}

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?