LoginSignup
7
0

More than 3 years have passed since last update.

Grove - Buzzer をNervesで鳴らす

Last updated at Posted at 2020-12-13

この記事はSeeed UG Advent Calendar 2020 14日目です。
前日は、「Grove Base HAT for RasPiは真っ直ぐグイっとさす」でした。


はじめに

  • Grove - BuzzerNervesから鳴らしてみようとおもいます
  • さっそくいろいろなものをつなげてやってみるの実践です
  • D16に挿してみました

IMG_20201213_233816.jpg

準備とかいろいろ

Run

  • 今回もとりあえずssh接続してIEx(Elixir's interactive shell)でやってみます
$ ssh nerves.local 
Interactive Elixir (1.11.2) - press Ctrl+C to exit (type h() ENTER for help)
Toolshed imported. Run h(Toolshed) for more info.
RingLogger is collecting log messages from Elixir and Linux. To see the
messages, either attach the current IEx session to the logger:

  RingLogger.attach

or print the next messages in the log:

  RingLogger.next

iex(1)> {:ok, gpio} = Circuits.GPIO.open(16, :output)
{:ok, #Reference<0.1045830398.268566543.199724>}
iex(2)> Circuits.GPIO.write(gpio, 1)
:ok
  • けっこう大きい音がします
  • フ、ピェ〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜」ってずーっと鳴ります :speaker:
  • 止めるには
iex(3)> Circuits.GPIO.write(gpio, 0)
:ok
  • 子供のときに夜中にフエをふくと :snake: がでるからやめなさい1と注意されたことをおもいだしました

Wrapping Up :christmas_tree::santa::santa_tone1::santa_tone2::santa_tone3::santa_tone4::santa_tone5::christmas_tree:

  • 手先が不器用な私でも工作できる!
    • 目覚ましアラームでボタン押すまで鳴らし続けるとかにつかえそう
      • 他にはCI失敗だとか、サービスの監視で異常検知時にとか
    • ただ、たいがいの時間で止めないと家に不在のときにそこそこ近所迷惑になりそう
    • そのくらい音がけっこうでかい :speaker: っちいうことですね
    • 小っちゃなボディだけど音がパワフル :punch::punch_tone1::punch_tone2::punch_tone3::punch_tone4::punch_tone5:
  • GrovePi+ Starter Kit for Raspberry Pi A+,B,B+&2,3,4 (CE certified)
    • いろいろ入っていて楽しめそう!!!
  • Enjoy Elixir !!! :rocket::rocket::rocket:
  • (って、アドベントカレンダーこんなんでいいですよね! :relaxed:)

次回は、@mongonta0716さんで「初心者向けWioTerminalの始め方【VisualStudioCode+PlatformIO編】」です。
引き続きお楽しみください。


  1. いまこれを書いているの 23:31 :sleeping: で、記事にするからには本当に鳴るよねって確かめるために、静かな田舎の集合住宅でちょいちょい鳴らしています。ごめんなさい :pray::pray_tone1::pray_tone2::pray_tone3::pray_tone4::pray_tone5:  

7
0
1

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
7
0