0
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 5 years have passed since last update.

電子回路入門 圧電スピーカー

Posted at

#はじめに
書籍に沿って引き続き進めていきます。

#圧電スピーカーとは
色々な機器に内蔵されたりしていて、よくピーピー鳴ってるやつです。(´・ω・`)

#使用部品

#回路図
抵抗に10kΩを使用していますが、抵抗値を小さくすると音が大きくなります。
圧電_ブレッドボード.png
圧電_回路図.png

#プロブラム
このプログラムでとりあえず音が出ます。
CyDelay → CyDelayUs へ変更すると高周波な音が出るので気を付けましょう。(私は頭が痛くなった(´・ω・`))

#include "project.h"
#include "stdio.h"

int main(void)
{
    CyGlobalIntEnable;
    for(;;)
    {
      Speaker_Write(1);
      CyDelay(1);
      Speaker_Write(0);
      CyDelay(1);
    }
}
0
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
0
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?