that_one_nigga_you_k

motor inegrador 2

Sep 14th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. int motor[] = {3, 4, 5, 6, 7, 8};
  2. int maI = 4;
  3. int maII = 5;
  4. int vela = 3;
  5.  
  6. void setup() {
  7.   // put your setup code here, to run once:
  8.   for(int i = 0; i<6; i++){
  9.     pinMode(motor[i], OUTPUT);
  10.   }
  11.  
  12. }
  13.  
  14. void loop() {
  15.   // put your main code here, to run repeatedly:
  16.   void frente();
  17.   void trás();
  18. }
  19. void frente(){
  20.   digitalWrite(maI, 1);
  21.   digitalWrite(maII, 0);
  22.   analogWrite(vela,200);
  23.   delay(500);
  24. }
  25. void tras(){
  26.   digitalWrite(maI, 0);
  27.   digitalWrite(maII, 1);
  28.   analogWrite(vela,200);
  29.   delay(500);
  30. }
Add Comment
Please, Sign In to add comment