please help trying to use the "if" Statement Solved
hi
i new , trying learn....please see simple sketch
it works great trying next if delayperiod = 100 i start again , have delayperiod = 10....i cant correct keep getting errors thank in advance patrick
/*
test sketch learn.
*/
// pin 13 has led connected on arduino boards.
// give name:
int led = 13;
int delayperiod = 10;
// setup routine runs once when press reset:
void setup() {
// initialize digital pin output.
pinmode(led, output);
}
// loop routine runs on , on again forever:
void loop() {
digitalwrite(led, high); // turn led on (high voltage level)
delay (delayperiod); // wait
digitalwrite(led, low); // turn led off making voltage low
delay(delayperiod); // wait
delayperiod = delayperiod + 1;
}
i new , trying learn....please see simple sketch
it works great trying next if delayperiod = 100 i start again , have delayperiod = 10....i cant correct keep getting errors thank in advance patrick
/*
test sketch learn.
*/
// pin 13 has led connected on arduino boards.
// give name:
int led = 13;
int delayperiod = 10;
// setup routine runs once when press reset:
void setup() {
// initialize digital pin output.
pinmode(led, output);
}
// loop routine runs on , on again forever:
void loop() {
digitalwrite(led, high); // turn led on (high voltage level)
delay (delayperiod); // wait
digitalwrite(led, low); // turn led off making voltage low
delay(delayperiod); // wait
delayperiod = delayperiod + 1;
}
try:
if (delayperiod == 100 )
{
delayperiod = 10;
}
if (delayperiod == 100 )
{
delayperiod = 10;
}
Arduino Forum > Using Arduino > Programming Questions > please help trying to use the "if" Statement Solved
arduino
Comments
Post a Comment