Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int control=2;
- char procitan=0;
- void setup() {
- // initialize digital pin 13 as an output.
- pinMode(control, OUTPUT);
- Serial.begin(9600);
- }
- // the loop function runs over and over again forever
- void loop() {
- while (Serial.available())
- {
- procitan=Serial.read();
- if(procitan=='w')
- {
- digitalWrite(control, HIGH);
- Serial.println("High");
- }
- if(procitan=='a')
- {
- digitalWrite(control, LOW);
- Serial.println("low");
- }
- if(procitan=='q')
- {
- digitalWrite(control, HIGH);
- delay(2000);
- digitalWrite(control, LOW);
- Serial.println("low");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement