Asking for multiple integer user input?


my program pretty simple: using pwm control dc motor hooked uno. wanting next ask user input set maximum , minimum speed motor. way motor start min. speed , gradually increase max. speed. decrease down min. , cycle forever. , possible have board run program after close serial monitor? have control program figured out already, can't serial monitor work should. tips?

thanks.


code: [select]
int motorpin = 3;

void setup(){
pinmode(motorpin, output);
}

void loop(){
for(int speed=0; speed<=255; speed+=1){
  analogwrite(motorpin, speed);
  delay(30);
}


for(int speed=255; speed>=0; speed-=1){
  analogwrite(motorpin, speed);
  delay(30);
}


}


i'm guessing want user able type 20 or 240 set values.

the code in data input demo in function readseveralchars() should give ideas.

...r


Arduino Forum > Using Arduino > Programming Questions > Asking for multiple integer user input?


arduino

Comments

Popular posts from this blog

Connecting Raspberry Pi 2 to P10(1R)-V706 LED Dot Matrix - Raspberry Pi Forums

TypeError: <unknown> is not a numpy array - Raspberry Pi Forums

datso and removing imagetitle - Joomla! Forum - community, help and support