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?
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?
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
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.