that_one_nigga_you_k

sweet

Apr 15th, 2019
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. void setup() {
  2.   // put your setup code here, to run once:
  3.   pinMode(12, OUTPUT);
  4.   pinMode(13, OUTPUT);
  5. }
  6.  
  7. void loop() {
  8.   // put your main code here, to run repeatedly:
  9.  frente(180, 1000);
  10.  freio(300);
  11.  re(255, 1000);
  12.  freio(500);
  13. }
  14.  
  15. void frente(int pot, int temp){
  16.   analogWrite(12, pot);
  17.   analogWrite(13, 0);
  18.   delay(temp);
  19. }
  20.  
  21. void freio(int temp){
  22.   analogWrite(12, 0);
  23.   analogWrite(13, 0);
  24.   delay(temp);
  25. }
  26.  
  27. void re(int pot, int temp){
  28.   analogWrite(12, 0);
  29.   analogWrite(13, pot);
  30.   delay(temp);
  31. }
Add Comment
Please, Sign In to add comment