does code arduino? can't figure out problems code , on code see if intend to.
what it's supposed do: generate number , use 8 leds on breadboard signify if guess high, low or spot on, , respond accordingly.
what's wrong code: "serial doesn't have type", also, idk how leds going react. gonna blink @ once 100ms delay, or gonna blink once @ time in order?
if can me, that'd great.
serial.begin(9600) {
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() {
serial.println("guess number between 0-255");
number = serial.readline;
randnumber = random(255);
while (serial.available() == 0);
number = serial.parseint();
while (number < 255({
//if (money)<255// computer generate random number
serial.println("guess number")
};
while (serial.available() == 0);
answer = serial.read();
if (guess > num) {
(
answer == 'n');
printin("guess low, try again.");
digitalwrite(2, 3, 4, 5, 6, 7, 8, 9)low);
delay(100);
}
if (guess < num) {
answer == 'n')
printin("guess high, try again.");
digitalwrite(9, 8, 7, 6, 5, 4, 3, 2, 1) high);
delay(100);
}
else {
yes
number = number = number
println ("you won! *cue john cena theme song*");
digitalwrite(2, 3, 4, 5, 6, 7, 8, 9 high);
}
}
what it's supposed do: generate number , use 8 leds on breadboard signify if guess high, low or spot on, , respond accordingly.
what's wrong code: "serial doesn't have type", also, idk how leds going react. gonna blink @ once 100ms delay, or gonna blink once @ time in order?
if can me, that'd great.
serial.begin(9600) {
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() {
serial.println("guess number between 0-255");
number = serial.readline;
randnumber = random(255);
while (serial.available() == 0);
number = serial.parseint();
while (number < 255({
//if (money)<255// computer generate random number
serial.println("guess number")
};
while (serial.available() == 0);
answer = serial.read();
if (guess > num) {
(
answer == 'n');
printin("guess low, try again.");
digitalwrite(2, 3, 4, 5, 6, 7, 8, 9)low);
delay(100);
}
if (guess < num) {
answer == 'n')
printin("guess high, try again.");
digitalwrite(9, 8, 7, 6, 5, 4, 3, 2, 1) high);
delay(100);
}
else {
yes
number = number = number
println ("you won! *cue john cena theme song*");
digitalwrite(2, 3, 4, 5, 6, 7, 8, 9 high);
}
}
you pulling our leg.
Arduino Forum > Using Arduino > Programming Questions > coding help?
arduino
Comments
Post a Comment