Advertisement
pleasedontcode

Nimo rev_03

Nov 12th, 2023
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /********* Pleasedontcode.com **********
  2.  
  3.     Pleasedontcode thanks you for automatic code generation! Enjoy your code!
  4.  
  5.     - Terms and Conditions:
  6.     You have a non-exclusive, revocable, worldwide, royalty-free license
  7.     for personal and commercial use. Attribution is optional; modifications
  8.     are allowed, but you're responsible for code maintenance. We're not
  9.     liable for any loss or damage. For full terms,
  10.     please visit pleasedontcode.com/termsandconditions.
  11.  
  12.     - Project: Nimo
  13.     - Source Code compiled for: Arduino Uno
  14.     - Source Code created on: 2023-11-13 03:06:31
  15.     - Source Code generated by: personal
  16.  
  17. ********* Pleasedontcode.com **********/
  18. /****** DEFINITION OF LIBRARIES *****/
  19. #include <Arduino.h>
  20. #include <Servo.h>
  21.  
  22. /****** SYSTEM REQUIREMENT 1 *****/
  23. /* When send a command the servo turn to 10 degree */
  24. /* and when b command send the servo back to their */
  25. /* original position */
  26.  
  27. /****** FUNCTION PROTOTYPES *****/
  28. void setup(void);
  29. void loop(void);
  30.  
  31. /***** DEFINITION OF PWM OUTPUT PINS *****/
  32. const uint8_t V3003_Servomotor_PWMSignal_PIN_D3 = 3;
  33.  
  34. /****** DEFINITION OF LIBRARIES CLASS INSTANCES*****/
  35. Servo myservo; // Instantiate the Servo class object
  36.  
  37. void setup(void)
  38. {
  39.   // put your setup code here, to run once:
  40.   myservo.attach(V3003_Servomotor_PWMSignal_PIN_D3); // Attach the servo to the PWM pin
  41. }
  42.  
  43. void loop(void)
  44. {
  45.   // put your main code here, to run repeatedly:
  46.   myservo.write(10); // Turn the servo to 10 degrees
  47.   delay(1000); // Wait for 1 second
  48.  
  49.   myservo.write(90); // Return the servo to its original position (90 degrees)
  50.   delay(1000); // Wait for 1 second
  51. }
  52.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement