最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

用Arduino實(shí)現(xiàn)雙聲道和弦播放馬里奧地下

2022-01-16 11:20 作者:你竟然打我-_-  | 我要投稿

這次的播放對(duì)象是馬里奧兄弟地下城音樂(lè)

MIDI是這個(gè)樣子的,同時(shí)兩個(gè)音調(diào)和弦

遺憾的是,Arduino自帶的tone函數(shù)同一時(shí)間只支持一個(gè)引腳輸出,同時(shí)運(yùn)行兩個(gè)tone只執(zhí)行一個(gè)命令,因?yàn)橛玫膯我欢〞r(shí)器。解決辦法還是有的,安裝Tone庫(kù),庫(kù)的名字就叫Tone。詳見(jiàn)https://github.com/bhagman/Tone

這個(gè)庫(kù)非常好,

The library uses the hardware timers on the microcontroller to generate square-wave tones in the audible range.

You can output the tones on any pin (arbitrary). The number of tones that can be played simultaneously depends on the number of hardware timers (with CTC capability) available on the microcontroller.

  • ATmega8: 2 (timers 2, and 1)

  • ATmega168/328: 3 (timers 2, 1, and 0)

  • ATmega1280: 6 (timers 2, 3, 4, 5, 1, 0)

意思就是說(shuō)我的nano最多可以三聲道和弦,接下來(lái)就開(kāi)干吧,上代碼:

pitches.h

主程序MarioUnderworld


用Arduino實(shí)現(xiàn)雙聲道和弦播放馬里奧地下的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
长葛市| 鸡泽县| 鞍山市| 江川县| 新龙县| 攀枝花市| 盐亭县| 玉林市| 衡东县| 永年县| 泽库县| 辉南县| 娄烦县| 华亭县| 镇坪县| 县级市| 察隅县| 安岳县| 铜鼓县| 聂荣县| 大名县| 鸡东县| 墨脱县| 三都| 巫溪县| 灵台县| 涿州市| 电白县| 龙陵县| 永康市| 巴青县| 日土县| 南安市| 嘉禾县| 奇台县| 安阳市| 嘉义市| 高邮市| 汨罗市| 罗平县| 高要市|