国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(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ó)家法律
吉木乃县| 固安县| 丰都县| 星座| 沂水县| 庄浪县| 星座| 板桥市| 阜平县| 平南县| 孝感市| 淄博市| 霍州市| 西乌| 怀集县| 寿光市| 鄂州市| 大田县| 武强县| 溆浦县| 东港市| 定西市| 商城县| 白山市| 榕江县| 漳州市| 锡林郭勒盟| 清水县| 茌平县| 建宁县| 通江县| 乡宁县| 贺州市| 湖北省| 宁武县| 萨嘎县| 宿州市| 延安市| 龙海市| 高台县| 望江县|