Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1.  
  2. #define Moteur 10
  3.  
  4.  
  5. void PULSE_SERVO(int,float);
  6.  
  7. void setup()
  8. {
  9.  
  10. }
  11.  
  12. void loop()
  13. {
  14. while(1)
  15. {
  16. PULSE_SERVO (Moteur, 1500);
  17. delay(20);
  18. }
  19. }
  20.  
  21. void PULSE_SERVO (int PIN,float valeur)
  22. {
  23. long temp;
  24.  
  25. digitalWrite(Moteur, HIGH);
  26.  
  27. temp = micros();
  28.  
  29. while((micros()-temp)<(valeur-27));
  30.  
  31. digitalWrite(Moteur, LOW);
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement