that_one_nigga_you_k

motor integrador

Sep 14th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 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. int velb = 8;
  6. int mbI = 6;
  7. int mbII = 7;
  8.  
  9. void setup() {
  10.   // put your setup code here, to run once:
  11.   for(int i = 0; i<6; i++){
  12.     pinMode(motor[i], OUTPUT);
  13.   }
  14.  
  15. }
  16.  
  17. void loop() {
  18.   // put your main code here, to run repeatedly:
  19.  
  20.  
  21.  
  22.   digitalWrite(mbI, 1);
  23.   digitalWrite(mbII, 0);
  24.   analogWrite(velb,200);
  25.   delay(2500);
  26.  
  27.  
  28.   digitalWrite(mbI, 0);
  29.   digitalWrite(mbII, 1);
  30.   analogWrite(velb,200);
  31.   delay(2500);
  32. }
Add Comment
Please, Sign In to add comment