Thread: How to program piezo buzzer?

  1. #1
    Registered User
    Join Date
    Oct 2019

    Question How to program piezo buzzer?

    Hi, Im quite new with C programming for microcontroller mk20dx128 and using CodeWarrior for coding. Can I know how to start the coding for program the piezo buzzer?

  2. #2
    Registered User
    Join Date
    May 2009
    Do you know how to blink an LED?

    If not, learn that first.

    If yes, then some buzzer will work in place of the LED; research about the input needed to buzzer.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    The micro controller doesn't have a piezo buzzer.
    That's a feature of whatever board the micro controller is presently attached to.

    So your first task is read the documentation for your board.

    If it's a well supported commercial board, there may well be application notes which describe the very task you're trying to achieve.

    If not, the general board documentation will describe in general how to interact with the hardware (such as a buzzer) and also provide specific information on where the buzzer appears (like a port, register, interface).
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Quick buzzer
    By Afsaneh in forum C Programming
    Replies: 19
    Last Post: 12-23-2018, 06:40 AM
  2. Replies: 2
    Last Post: 09-09-2014, 02:36 PM
  3. Replies: 14
    Last Post: 01-26-2010, 11:18 AM
  4. Replies: 1
    Last Post: 03-03-2009, 04:47 PM
  5. buzzer?
    By MJS252 in forum C++ Programming
    Replies: 14
    Last Post: 07-05-2007, 02:12 PM

Tags for this Thread