#define LED_PIN 13
int DT = 2000;
void setup() {
pinMode(LED_PIN,OUTPUT);
Serial.begin(9600);
Serial.println("Please select: \n + - increase_speed \n - - decrease_speed");
}
void loop() {
char inp;
if(Serial.available() > 0){
inp = Serial.read();
if (inp == '+') {
DT = DT + 200;
}
else if (inp == '-'){
DT = DT+ - 200;
} else{
DT = 2000;
}
}
digitalWrite(LED_PIN, HIGH);
delay(DT);
digitalWrite(LED_PIN, LOW);
delay(DT);
}
No comments:
Post a Comment