arduino出现java错误_Arduino 'for'错误

我已经为我的Arduino制作了一个程序,它将按升序或降序排序五十个随机数的数组,我想我已经把它弄好了,但是当我运行它时,我收到一条错误消息“期望不合格的id之前”为'“ .

int array [50];

int i = 0;

void setup() {

Serial.begin(9600); // Load Serial Port

}

void loop() {

// put your main code here, to run repeatedly:

Serial.println ("Position " + array[i]);

delay (2000);

}

for (i <= 50) {

int n = random (251); // Random number from 0 to 250

array[i] = n;

i++;

}

// Bubble sort function

void sort (int a[], int size) {

for(int i=0; i

for(int o=0; o

if(a[o] > a[o+1]) {

int t = a[o];

a[o] = a[o+1];

a[o+1] = t;

}

}

}

}

我已注释显示错误的位置 . 我需要通过这个来测试我的代码,我不知道如何解决它!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值