0

Can someone help me with this code?

Eu estou tentando fazer um código para gerar uma posição aleatória, mas parece erro, alguém pode descobrir o que está errado com isso?

 

code:

int _m_kix_c = 0;

int j_khyjky = 0;

void setup()
{
pinMode(A5, INPUT);
pinMode(A3, OUTPUT);
pinMode(A2, OUTPUT);
pinMode(A1, OUTPUT);
pinMode(A0, OUTPUT);
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(10, OUTPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
}

void loop()
{
if (analogRead(A5) == HIGH) {
j,khyjky = random(9, 16 + 1);
if (j,khyjky == 9) {
digitalWrite(A3, HIGH);
delay(100); // Wait for 100 millisecond(s)
digitalWrite(A3, LOW);
}
if (j,khyjky == 10) {
digitalWrite(A2, HIGH);
delay(100); // Wait for 100 millisecond(s)
digitalWrite(A2, LOW);
}
if (j,khyjky == 11) {
digitalWrite(A1, HIGH);
delay(100); // Wait for 100 millisecond(s)
digitalWrite(A1, LOW);
}
if (j,khyjky == 12) {
digitalWrite(A0, HIGH);
delay(100); // Wait for 100 millisecond(s)
digitalWrite(A0, LOW);
}
if (j,khyjky == 13) {
digitalWrite(13, HIGH);
delay(100); // Wait for 100 millisecond(s)
digitalWrite(13, LOW);
}
if (j,khyjky == 14) {
digitalWrite(12, HIGH);
delay(100); // Wait for 100 millisecond(s)
digitalWrite(12, LOW);
}
if (j,khyjky == 15) {
digitalWrite(11, HIGH);
delay(100); // Wait for 100 millisecond(s)
digitalWrite(11, LOW);
}
if (j,khyjky == 16) {
digitalWrite(10, HIGH);
delay(100); // Wait for 100 millisecond(s)
digitalWrite(10, LOW);
}
}

if (analogRead(A5) == HIGH) {
,m.kix c = random(1, 8 + 1);
if (,m.kix c == 1) {
digitalWrite(2, HIGH);
delay(100); // Wait for 100 millisecond(s)
digitalWrite(2, LOW);
}
if (,m.kix c == 2) {
digitalWrite(3, HIGH);
delay(100); // Wait for 100 millisecond(s)
digitalWrite(3, LOW);
}
if (,m.kix c == 3) {
digitalWrite(4, HIGH);
delay(100); // Wait for 100 millisecond(s)
digitalWrite(4, LOW);
}
if (,m.kix c == 4) {
digitalWrite(5, HIGH);
delay(100); // Wait for 100 millisecond(s)
digitalWrite(5, LOW);
}
if (,m.kix c == 5) {
digitalWrite(6, HIGH);
delay(100); // Wait for 100 millisecond(s)
digitalWrite(6, LOW);
}
if (,m.kix c == 6) {
digitalWrite(7, HIGH);
delay(100); // Wait for 100 millisecond(s)
digitalWrite(7, LOW);
}
if (,m.kix c == 7) {
digitalWrite(8, HIGH);
delay(100); // Wait for 100 millisecond(s)
digitalWrite(8, LOW);
}
if (,m.kix c == 8) {
digitalWrite(9, HIGH);
delay(100); // Wait for 100 millisecond(s)
digitalWrite(9, LOW);
}
}
}

0 comments

Please sign in to leave a comment.