文件名称:electric-piano
- 所属分类:
- 其他嵌入式/单片机内容
- 资源属性:
- [C/C++] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 1kb
- 下载次数:
- 0次
- 提 供 者:
- g**
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
This example describes how to implement a scanning keyboard and then from the pressed key generate a corresponding defined sound frequency. Each time a key is pressed the corresponding frequency value is placed into the timer/counter register. When this counter counts to its maximum value an internal interrupt is generated and the interrupt routine is run. At this point the timer/counter register value is reloaded and the counting continues. In this way, by programming different values into the timer/counter register, different values of frequency can be generated. The internal interrupt routine contains code to change the state of the output port and thus generate the required frequency on a corresponding pin and create the desired note. By adding a suitable amplifier and speaker the system is complete. The important point of the software is to use the timer/counter as a counter to control the output frequency. This frequency has to be calculated.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
electric piano\piano.c
..............\piano.OPT
..............\piano.PRJ
electric piano
..............\piano.OPT
..............\piano.PRJ
electric piano