【发布时间】:2013-10-15 19:28:02
【问题描述】:
有人可以帮我解决代码问题吗?我得到了通用编译错误: 错误:“{”标记之前的预期主表达式
加上这部分代码代码:
for (int i=0; i<2; i++) {
PotValue[i] = analogRead(PotPin[i]); //This is the error line
MappedPotValue[i]=(PotValue[i]+1)/103;
//SomeCode Here
}
所以。我的目标是在 PotValue 数组中写入 Arduino Board 中所有 Pot 的所有值
PotValue 和 MappedPotValue 是长度为 2 的 int 数组
PotPin 已被声明为:
#define PotPin {A0, A1} // These are two analog pins on arduino board
for 循环在定时器中断中
谢谢帮助
【问题讨论】:
-
analogRead采取什么论据?
标签: c++ arrays for-loop arduino