UPM

The UPM API is a high level sensor library for IoT devices using MRAA. See examples here. Back to index page.
SparkFun sensor images provided under CC BY-NC-SA-3.0.

GroveSpeaker Class

Module: grovespeaker
  • ID: grovespeaker
  • Name: Speaker Module
  • Category: sound
  • Manufacturer: seeed
  • Connection: gpio
  • Kit: hak

UPM module for the Grove Speaker . This sensor can generate different tones and sounds depending on the frequency of the input signal.
grovespeaker.jpg

Item Index

Methods

GroveSpeaker

(
  • pin
)
Number

Grove Speaker constructor

Parameters:

  • pin Number

    Digital pin to use

Returns:

Number:

playAll

()

Plays all alto notes (lowest notes)

playSound

(
  • letter
  • sharp
  • vocalWeight
)

Plays a sound and a note whether it's sharp or not

Parameters:

  • letter String

    Character name of the note ('a', 'b', 'c', 'd', 'e', 'f', or 'g')

  • sharp Boolean

    If true, plays a sharp version of the note; otherwise, does not play the note

  • vocalWeight String

    String to determine whether to play a low ("low"), a medium ("med"), or a high ("high") note