Go Down

Topic: imput from keyboard (Read 579 times) previous topic - next topic


I'm just trying to get started and I was wondering about how to imput data from keyboard. What should I ad to this code in order to ask the operator for the value of delayValue? thanks

int ledPin13 = 13;// LED connected to digital pin 13
int ledPin12 = 12;
int ledPin11 = 11;
int ledPin10 = 10;
int delayValue =1000;

void setup()                    // run once, when the sketch starts
 pinMode(ledPin13,OUTPUT);   // sets the digital pin as output

void loop()                     // run over and over again
 digitalWrite(ledPin13, HIGH);   // sets the LED on
 delay(delayValue);                  // waits for a second
 digitalWrite(ledPin12,LOW);// led 12
 digitalWrite(ledPin11,HIGH); //led 11
 digitalWrite(ledPin10,LOW); //led 10
 digitalWrite(ledPin13, LOW);    // sets the LED off
 delay(delayValue);                  // waits for a second
 digitalWrite (ledPin10,HIGH);
 delay (delayValue);

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131