ARDUINO-tohu

ARDUINO Pūoko Buzzer 5V Kōwae

ARDUINO-Sensor-Buzzer-5V-Module-product-img

Arduino Sensor Buzzer 5V Manual Kaiwhakamahi

Ko te Arduino Sensor Buzzer 5V he taputapu hiko e whakamahia ana hei whakatangi i nga oro me nga waiata. Ka mau te advantage o te kaha o te tukatuka ki te whakaputa tohu PWM hei purei puoro. Ka honoa te buzzer ki te titi nama 9, e tautoko ana i te mahi o te tuhi tohu PWM ki a ia.

He mea nui kia mohio he polarity nga buzzers. He waea whero me te waea pango nga taputapu hokohoko, e tohu ana me pehea te whakauru ki te papa.

Hononga Hua

Arduino 5V GND Pine 9
+ S

Exampte 1: Play Melody

// Play Melody
// ----------
// Program to play a simple melody
//
// Tones are created by quickly pulsing a speaker on and off
// using PWM, to create signature frequencies.
//
// Each note has a frequency, created by varying the period of
// vibration, measured in microseconds. We'll use pulse-width
// modulation (PWM) to create that vibration.
//
// We calculate the pulse-width to be half the period; we pulse

Hei whakamahi i te Arduino Sensor Buzzer 5V, whai i enei mahi:

  1. Honoa te titi 5V o te papa Arduino ki te tauranga pai (+) o te buzzer.
  2. Honoa te titi GND o te papa Arduino ki te tauranga whenua o te buzzer (GND).
  3. Honoa te titi o te papa Arduino 9 ki te tauranga tohu (S) o te buzzer.

Ina oti nga hononga, ka taea e koe te tuku i te ex kua whakaratohiaampte waehere ki to papa Arduino. Ma tenei waehere ka purei i tetahi oro ngawari ma te whakamahi i te huringa-whanui (PWM) hei hanga i nga oro rereke.

Whakatangihia te Melody

  • Ko tenei exampKa whakamahi a le i te buzzer ki te purei i nga waiata. Kei te tango tatou i te advantage o nga kaitukatuka kaha ki te whakaputa tohu PWM hei purei puoro.
  • Ko te buzzer he mea noa he taputapu hiko e whakamahia ana ki te purei oro I to tatou exampkei te hono tatou i te buzzer ki runga i te pine nama 9, e tautoko ana i te mahi o te tuhi tohu PWM ki a ia, kaua ko te uara HIGH noa, iti ranei.
  • Ko te ex tuatahiampKa tukuna noa e te waehere he ngaru tapawha ki te buzzer, ko te tuarua ka whakamahi i te mahi PWM hei whakahaere i te rōrahi ma te huri i te Whanui Pulse.
  • Ko tetahi atu mea hei maumahara, he polarity te buzzers, he waea whero me te waea pango nga taputapu arumoni e tohu ana me pehea te hono ki te papa.

Hononga

  • Arduino 412 ARDUINO SENSOR BUZZER 5V
  • 5V +
  • GND -
  • Pin 9 S

Exampte 1: Play Melody

  • Whakatangihia te Melody
  •  ———–
  • Papatono ki te purei i tetahi waiata ngawari
  • Ka waihangahia nga oro ma te whakaweto tere i te kaikorero
  • te whakamahi i te PWM, hei hanga i nga iarere waitohu.
  • Kei ia tuhipoka he auau, ka hangaia ma te rereke i te waa o
  • te wiri, ka ine i roto i te microseconds. Ka whakamahia e matou te whanui-pupuhi
  • modulation (PWM) ki te hanga i taua wiri.
  • Ka tatauhia e matou te whanui-tere hei haurua o te wa; ka paopao matou * te kaikōrero HIGH mo te 'purse-wide' microseconds, kātahi KAUPAPA
  • mo te 'purse-wide' microseconds.
  • Ko tenei pupuhi ka hanga he wiri o te auau e hiahiatia ana.
  • (cleft) 2005 D. Cuartielles mo K3
  • Refactoring me nga korero 2006 uku.shirky@nyu.edu
  • Tirohia NOTES i roto i nga korero i te mutunga mo nga whakapainga ka taea

ARDUINO-Sensor-Buzzer-5V-Module-fig-1 ARDUINO-Sensor-Buzzer-5V-Module-fig-2ARDUINO-Sensor-Buzzer-5V-Module-fig-3 ARDUINO-Sensor-Buzzer-5V-Module-fig-4

  • E kii ana te hotaka ki te pupuri i te reo mo te 'roa' microseconds.
  • He teka teka! Ka mau mo te iti rawa 'roa' microseconds, _plus_
    • ko tetahi o runga i hangaia ma te whakanui ake i te wa kua hipa (ka nui ake pea i te
    • 3K microseconds) _plus_ overhead of looping and two digitalWrites()
  • Ko te mutunga, ka puhoi ake te tangi o te 'roa' i te okiokinga
  • o 'roa.' Ka hangaia e te rest_count he taurangi porowhita hei kawe mai i nga patu 'okianga'
  • i roto i te rarangi me nga pao 'tono' he rite te roa.
  • rest_count ka pangia e te hanganga maramara me te tere, me
    • i runga ake i tetahi kaupapa mods. Ko te whanonga o mua ehara i te taurangi mo te heke mai
    • mahi. Ka rereke pea to maero. Whakanuia te rama ka haere atu.
  • Ka taea e tenei te whakamahi i te maha o nga whakapainga:
  • Tāpirihia te waehere kia taea e te kaihātaka te whakarite kia hia nga wa e tika ai te waiata
  • koropiko i mua i te tu
  • ADD tetahi atu octave
  • nukuhia te wa, te okioki, me te okioki_ tatau ki te #whakatau korero
  • TUHIA Anō ki te whakauru i te rōrahi, te whakamahi analogWrite, pera me te kaupapa tuarua i
  • http://www.arduino.cc/en/Tutorial/PlayMelody
  • ADD waehere hei whakarite i te waa ma te kohua me etahi atu taputapu whakauru
  • Tāpirihia te waehere hei tango i te waa, i te rōrahi ranei ka taea e te whakawhitiwhiti korero
  • (Me 0005 teitei ake ranei.)
  • ADD waehere ki te hanga i te oro offset (teitei ake ranei) i roto i te kohua etc
  • WHAKAHUIA te waiata matapōkere me te whakatuwhera i nga tutaki ki te 'Smoke on the Water'
  • Putanga tuarua, me te huinga mana rōrahi ma te whakamahi analogWrite()

Whakatangihia te Melody

Papatono ki te purei i nga waiata kua rongoa ki roto i te rarangi, me mohio * mo nga take o te waa me te purei oro.

  • Ko te tatauranga o nga oro ka mahia i muri i te mahi * pangarau:
    • waTeitei = 1/(2 * oroWarere) = wa / 2
    • kei te whakaahuahia nga momo oro penei i te ripanga:
    • tuhipoka wā auau PW (timeHigh)
    • c 261 Hz 3830 1915
    • d 294 Hz 3400 1700
    • e 329 Hz 3038 1519
    • f 349 Hz 2864 1432
    • g 392 Hz 2550 1275
    • he 440 Hz 2272 1136
    • b 493 Hz 2028 1014
    • C 523 Hz 1912 956
    • (kapiti) 2005 D. Cuartielles mo K3 */

ARDUINO-Sensor-Buzzer-5V-Module-fig-5 ARDUINO-Sensor-Buzzer-5V-Module-fig-6

Tuhinga / Rauemi

ARDUINO Pūoko Buzzer 5V Kōwae [pdf] Pukapuka Kaiwhakamahi
412, Pūoko Buzzer 5V Kōwae, Buzzer 5V Kōwae, 5V Kōwae

Tohutoro

Waiho he korero

Ka kore e whakaputaina to wahitau imeera. Kua tohua nga mara e hiahiatia ana *