Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include <Arduino.h>
  2. #include <Servo.h>
  3.  
  4. Servo miniServo;
  5. int mini = 0;
  6.  
  7. void setup() {
  8. Serial.begin(9600);
  9. miniServo.attach(4);
  10. }
  11.  
  12. void loop() {
  13. if (Serial.available() > 0)
  14. {
  15. Serial.println("value now is: " +mini);
  16. Serial.println("enter number between 0-180: ");
  17. mini = Serial.read();
  18. delay(250);
  19. miniServo.write(mini);
  20. }
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement