Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define Up 4 //Pino 13 clock
- #define Down 5 //Pino 12 clock
- char buf;
- //-----------------------------
- void setup()
- {
- Serial.begin(9600);
- pinMode(Up, OUTPUT);
- pinMode(Down, OUTPUT);
- }
- //-----------------------------
- void loop()
- {
- if (Serial.available() > 0)
- {
- buf = Serial.read();
- delay(20);
- }
- if (buf == '1')
- {
- digitalWrite(Up, LOW);
- delay(100);
- digitalWrite(Up, HIGH);
- buf = 0;
- }
- if (buf == '2')
- {
- digitalWrite(Down, LOW);
- delay(100);
- digitalWrite(Down, HIGH);
- buf = 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement