极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9903|回复: 0

drduino直流电机做音乐

[复制链接]
发表于 2014-1-10 19:16:05 | 显示全部楼层 |阅读模式
本帖最后由 Tonycxc122 于 2014-1-10 19:20 编辑

]把这个代码复制到arduino里,接音箱甚至接直流电机都能听到效果,{:soso_e144:} ,接线: 1线——GND  2线——8

void setup()
{
}

void loop()
{
tone(8, 262, 200);
delay( 350 );
tone(8, 277, 200);
delay( 350 );
tone(8, 294, 200);
delay( 350 );
tone(8, 311, 200);
delay( 350 );
tone(8, 330, 200);
delay( 350 );
tone(8, 349, 200);
delay( 350 );
tone(8, 370, 200);
delay( 350 );
tone(8, 392, 200);
tone(8, 415, 200);
delay( 350 );
tone(8, 440, 200);
delay( 350 );
tone(8, 466, 200);
delay( 350 );
tone(8, 494, 200);
delay( 350 );
delay( 1000 );
}
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 需要先绑定手机号

Archiver|联系我们|极客工坊

GMT+8, 2024-4-25 15:07 , Processed in 0.047789 second(s), 17 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表