6
10
28
新手上路
使用道具 举报
1万
6万
10万
管理员
for i= 0, 300, 0.1 do s = string.format("%f,", 0.01*math.sin(2*math.pi*120*i/300)) print(s) s1 = string.format("%f", 0.01*math.sin(2*math.pi*60*i/300)) print(s1) print_wave(s..s1) delayms(2) end
eric2013 发表于 2023-8-24 00:59 你的 i 递增是多少,我用LUA小程序递增0.1测试了下,没问题 [mw_shl_code=lua,true]for i= 0, 300, 0.1 ...
gcpwd123 发表于 2023-8-24 07:47 非常感谢,我的递增函数是1,可能是这个问题导致的。还有个问题希望您回复我下,我想在单片机将该波形进 ...
eric2013 发表于 2023-8-24 09:44 定义个const数组,比如512个点 那么就是const float buf[512] = {具体的值都填入进来}
本版积分规则 发表回复 回帖后跳转到最后一页
|小黑屋|Archiver|手机版|硬汉嵌入式论坛
GMT+8, 2024-5-10 01:45 , Processed in 0.174154 second(s), 29 queries .
Powered by Discuz! X3.4 Licensed
Copyright © 2001-2023, Tencent Cloud.